Slashdot Mirror


Linux Distros with CVS/RCS for Config Files?

bergeron76 asks: "Does anyone know of a Linux distributions or modifications to a Linux d system that implement a CVS[like] structure for control over system configuration files (/etc, /usr/etc, and so on)? Personally, I'd love to see a distro that featured a native CVS/RCS control mechanism for editing system configuration files. Does anything like this currently exist? If not, is anyone working in this direction?"

36 comments

  1. Just do it by choi · · Score: 1

    nothing prevents you from just installing cvs and importing/checking out your config directories. i think it's really not that much work to justify a distro on its own.

    --
    Browse Slashdot at Funny+5, everything else -5. The only way to sustain it.
  2. Do it yourself by Matt+Perry · · Score: 1

    Why not just do it yourself? I keep all of my config files in CVS on my Debian and RedHat boxes. It's pretty easy to set things up to do this.

    --
    Slashdot: Failed Car Analogies. Amateur Lawyering. Anecdote Battles.
  3. Gentoo does this. by djcapelis · · Score: 3, Informative

    Gentoo offers several choices in managing the configuration files in /etc, one of these options is the dispatch-conf script which keeps all changes in RCS. This is mostly for updating... so it's not everything, but it's definately a strong start and you could likely use the same system to keep track of your own modifications.

    --
    I touch computers in naughty places
    1. Re:Gentoo does this. by jnana · · Score: 2, Informative

      Yes, dispatch-conf in combination with RCS is great. You can use it to manage config updates for whatever config files you want. You just need to put anything other than /etc in the CONFIG_PROTECT variable. Another great thing about dispatch-conf is that it can be easily configured to auto-update the configuration files if only CVS headers are different, or there are no differences but whitespace and comments. Definitely a big quantum leap above etc-update.

  4. Nothing is stopping you from doing this. by Feztaa · · Score: 4, Informative

    Just go into your /etc/, do a 'mkdir RCS', and then start checking your config files in and out of RCS to edit them. There's no code anywhere in linux that says 'if there's a directory I don't recognize, then crash spectacularly', so just adding the RCS directory itself isn't going to adversely affect anything.

    That's actually a really good idea, too, I'm not sure why I never thought of it myself...

    1. Re:Nothing is stopping you from doing this. by Atzanteol · · Score: 4, Informative

      There's no code anywhere in linux that says 'if there's a directory I don't recognize, then crash spectacularly'

      I beg to differ... I had an issue just last week where I tried checking /etc into a CVS repository. It turns out that /etc/devfs.d/ doesn't like *anything* in it that doesn't belong (like a CVS directory). This caused /dev to be very slim upon a reboot, and things like 'hda' et al were missing.

      Now, I'm not sure if this is purely a Gentoo issue or not (I'm not terribly familiar with devfs), but it's something to remember. Back up /etc/ before doing ANYTHING! lesson learned... :-)

      --
      "Ignorance more frequently begets confidence than does knowledge"

      - Charles Darwin
    2. Re:Nothing is stopping you from doing this. by Bombcar · · Score: 1

      Uh, try adding a CVS directory to /etc/rc3.d and see what happens. Things go boom in the boot, as it were.

    3. Re:Nothing is stopping you from doing this. by Feztaa · · Score: 2, Interesting

      In that case, devfs is broken. IMHO, programs should just look for the files that they need and ignore anything extra, that's the best way (provides the leanest code and the most flexible software... what's the point of adding code that says 'if (extra files) { die; }'? That doesn't accomplish anything).

    4. Re:Nothing is stopping you from doing this. by Feztaa · · Score: 1

      Well, ok. I don't think you need a CVS directory in rc3.d, that directory should only contain symlinks to the actual scripts that are in init.d anyway. And I *know* there's no code that will break if you add a CVS directory to /etc/init.d.

    5. Re:Nothing is stopping you from doing this. by Atzanteol · · Score: 2, Informative

      Well, from what I hear devfs is broken, but I think for different reasons. I doubt the kernel dev's put 'if(extra files) { die; }' in their code. It's probably something like 'for each file in dir; do something ; done', where each file is supposed to 'mean something'. Thus if a file (or directory) in the dir is 'configured wrong', bad things happen.

      It really messed me up for a couple days though, I'll tell ya that.

      --
      "Ignorance more frequently begets confidence than does knowledge"

      - Charles Darwin
    6. Re:Nothing is stopping you from doing this. by Ed+Avis · · Score: 2, Insightful

      In general, directories ending in '.d' are magic - a program looks at every file in the directory, rather than expecting a certain fixed set of filenames. For example under init.d for the various runlevels every file is run in sequence.

      The '.d' on the directory name tells you not to put random extra files in there. Apart from those directories, you can follow the rule that extra files won't break anything.

      --
      -- Ed Avis ed@membled.com
    7. Re:Nothing is stopping you from doing this. by kylegordon · · Score: 1

      The devfs code _is_ broken. To quote Al Viro -

      - it was determined that the same thing could be done in userspace
      - devfs had been shoved into the tree in hope that its quality will catch up
      - devfs was found to have fixable and unfixable bugs
      - the former had stayed around for many months with maintainer claiming that everything works fine
      - the latter had stayed, period.
      - the devfs maintainer/author disappeared and stoped maintaining the code.

  5. works for my user accounts by x00101010x · · Score: 4, Interesting

    I keep my entire home directory in a Subversion repository. Works great for linux and my windows boxes. Firefox and thunderbird user directories are compatible across platforms.
    I just add 'svn up' to my login script and 'svn ci --message "%HOST%@%TIME%%DATE%"' to my logout script.
    No reason it shouldn't work for a whole system with an initial 'svn up' somewhere in rc.local and periodic updates in a chron job. Just do a commit whenever you change things on your template system and 5 minutes later it'll be on all your boxen.

    There was a slashdot article about putting a home directory under version control a few months ago from which I got the idea, too lazy to find the link at the moment though.

    --
    DONT PANIC
    1. Re:works for my user accounts by Anonymous Coward · · Score: 0

      CVS homedir, by Joey Hess on LinuxJournal: http://linuxjournal.com/article.php?sid=5976

    2. Re:works for my user accounts by x00101010x · · Score: 1

      CVS homedir, by Joey Hess on LinuxJournal: http://linuxjournal.com/article.php?sid=5976

      Thanks, that was the one.

      --
      DONT PANIC
  6. BitKeeper by twoflower · · Score: 1

    Larry McVoy designed BitKeeper with the specific aim of doing this. I believe they also offer special single-user free licenses for this; you may want to check the BitKeeper documentation to see if there are any Linux distributions who actually took him up on this.

    --


    --
    Twoflower
    1. Re:BitKeeper by Anonymous Coward · · Score: 0

      "I believe they also offer special single-user free licenses for this"

      I think the license was workout with assistance from SCO's ethics department.

    2. Re:BitKeeper by Anonymous Coward · · Score: 0

      Too bad it didn't work. Bitkeeper actually leaves more turds than CVS (both a BitKeeper and an SCCS directory.)

      In the case of config scripts, a lot of the standard disadvantages of CVS -- or RCS, for that matter -- generally don't apply, so just try to use CVS or RCS.

  7. Most distros have CVS installed, right? by Neil+Blender · · Score: 1

    so:

    [user@localhost]# su
    password:
    [root@localhost]# cd /
    [root@localhost]# cvs import . -m 'my linux distro' mydistro username start

    1. Re:Most distros have CVS installed, right? by mrzaph0d · · Score: 1

      how'd you know my password?

      --
      this is just a placeholder till i send back my real sig from the future.
    2. Re:Most distros have CVS installed, right? by angst_ridden_hipster · · Score: 1

      Where this fails, of course, is with symbolic links.

      I once had a nightmarish situation emerge with a bunch of symlinked X11 dirs and CVS-ing my /etc directory. I won't bore you with *that* story...

      Still, for many users, just using CVS, as-is, should be sufficient.

      Another alternative is to backup directories like /etc with rdiff-backup. If you do it to another machine, you basically have a distributed backup with as much revision history as you've configured it to keep. Sweet!

      --
      Eloi, Eloi, lema sabachtani?
      www.fogbound.net
    3. Re:Most distros have CVS installed, right? by jclendenan · · Score: 1

      Another solution I've found very powerful in terms of a backup solution is Dirvish. It uses Rsync for transportation, and hardlinks all of the same files together, for a more effective use of disk space.

      It might also be a good alternative to CVS as you can just diff between full directory trees to determine the changed files. (or read the logs).

  8. Yes, Gentoo... by andrewdk · · Score: 2, Informative

    YEs, Gentoo can do this. Just emerge rcs, make an /etc/config-archive dir, setup /etc/dispatch-conf.conf, and just do dispatch-conf in place of etc-update.

  9. An old idea for modern times... by Deagol · · Score: 2, Insightful
    I think it was OpenVMS (fuzzy memories of a freshman computer class) that had version control built into the filesystem. I'm amazed that this hasn't been introduced into the more popular filesystem(s) yet. I've wished for it on many occasions.

    Or am I just being impatient? Will Reiser4 provide this capability?

    1. Re:An old idea for modern times... by yabHuj · · Score: 2, Interesting

      Yeah, it was with VMS and its smaller brother RSX-11M+ (and probably derivates). Each file got an additional "dot number" appended. A full (!) copy was saved (with raised number) each time the file was written. Accessing the file without version number simply gave you the currentmost one.

      But with running low on disk space all the time (those were the days when a hard disc had 5MB = five MegaBytes total capacity) , frequent use of the PURGE command erased all old copies quite often too early...

  10. FreeBSD by Scythe0r · · Score: 2, Interesting

    You should really check out a utility for FreeBSD called mergemaster. You run it after rebuilding/upgrading your system and it compares the latest "vanilla" system configuration files to what you've got.

    You can choose to overwrite your file, keep your file or merge the two together. I like to think of it as the ultimate choice in system housekeeping.

    1. Re:FreeBSD by Rysc · · Score: 1

      Debian does something almsot identical with its upgrades.

      --
      I want my Cowboyneal
    2. Re:FreeBSD by Anonymous Coward · · Score: 0

      Gentoo does the same with dispatch-conf, and has revision control using RCS..

  11. System Restore by yotaku · · Score: 1

    As many people have pointed out having versioning on the config of a system is hardly a new idea. If you think about what might happen if you try to make this idea simple and easy to use it might end up being something like System Restore for Windows, which stores versions before updates, and if you're smart you make a check point before installing any questionable software or drivers. And then allows you to roll back if something goes wrong and the uninstall doesn't fix it.

  12. changetrack by Christopher+Cashell · · Score: 1
    sudo apt-get install changetrack
    For non-Debian users, download changetrack from SourceForge.

    changetrack uses RCS as it's backend, not CVS (support for CVS is on the Todo list), but the end result is the same. It is specifically intended for tracking system files like those in /etc.
    --
    Topher
  13. dispatch-conf by trickycamel · · Score: 1

    Gentoo does this for your files in /etc. Use dispatch-conf and forget about etc-update. You can set it to use RCS, so no more overwrites of your configs.

    --
    Sig? What sig?
  14. Gentoo devfsd malfunction by Kalzus · · Score: 1

    This issue is going to happen on Gentoo because of how devfsd's configuration is built.

    Actually, something similar could conceivably go wrong with /etc/profile.d and /etc/env.d. A coding change on "etc-update" would probably solve the /etc/devfsd.d screwup.

    --
    "The Devil does not know a lot because He's the Devil, He knows a lot because he's old." -- unknown
  15. RCS and vim by wolf31o2 · · Score: 1

    At work, we have a simple wrapper for vim that does all of the RCS stuff for us, like checking in and checking out files. We use it on all of our production servers, as it gives use nice revision control over our files.

    #!/bin/bash

    ORIGVI=rcsvi

    case $1 in
    -r[0-9]*) VERSION=$1; shift ;;
    esac

    [ $# -eq 1 ] || { echo usage: vi [-rrev] filename >&2; exit 1; }
    DIR=`dirname $1`
    FILE=`basename $1`

    ### let vi handle error conditions
    cd $DIR || exec $ORIGVI $1
    [ -d $FILE ] && exec $ORIGVI $FILE

    ### skip certain directories
    { [ -r $HOME/.rcsvirc ] && . $HOME/.rcsvirc; } ||
    { [ -r /etc/rcsvirc ] && . /etc/rcsvirc; } ||
    EXCLUDE="/tmp | /tmp/* | /etc/skel | /etc/skel/* | /home | /home/* | /usr/home | /usr/home/*"
    [ -n "$EXCLUDE" ] && eval "case $PWD in $EXCLUDE) exec $ORIGVI $FILE ;; esac"

    ### create RCS directory if not exist
    [ -d RCS ] || { mkdir RCS || exit $?; }

    ### check $FILE for existence, break possible lock or exit, check in
    [ -e $FILE ] && { [ -e RCS/$FILE,v ] && { rcs -l $FILE || exit 1; }
    ci -q -l $FILE </dev/null; }
    [ -n "$VERSION" ] && { co $VERSION $FILE; chmod u+w $FILE; }

    ### edit $FILE
    $ORIGVI $FILE

    ### check in $FILE
    ci -u $FILE

    # EOF
  16. Yikes! by schon · · Score: 1

    I keep my entire home directory in a Subversion repository.

    Funny, when I first read that, I thought it said Rebversion...

    And I thought "Yikes! So that's what happened to the Goatse guy." :o)

  17. cfengine by bandix · · Score: 2, Informative

    You'll spend years fooling around with RCS and CVS for configuration versioning before realizing that what you really need is cfengine. CVS or svn for source code, cfengine for configuration. Cut to the chase:

    http://www.cfengine.org/

    --
    Brandon D. Valentine
  18. rvi by Anonymous Coward · · Score: 0

    there is a wrapper type thing for vi called rvi that automates this on any unix machine:

    http://www.cs.ru.ac.za/research/students/g98t441 4/ static/home/rvi/