Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
Linux Software

Linux Distros with CVS/RCS for Config Files? 36

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?"
This discussion has been archived. No new comments can be posted.

Linux Distros with CVS/RCS for Config Files?

Comments Filter:
  • 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.
  • 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.
  • Gentoo does this. (Score:4, Informative)

    by djcapelis ( 587616 ) on Monday July 19, 2004 @06:54PM (#9743121) Homepage
    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.
    • Re:Gentoo does this. (Score:2, Informative)

      by jnana ( 519059 )
      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.
  • by Feztaa ( 633745 ) on Monday July 19, 2004 @07:02PM (#9743198) Homepage
    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...
    • by Atzanteol ( 99067 ) on Monday July 19, 2004 @08:14PM (#9743767) Homepage
      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... :-)
      • 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).
        • 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.
        • The devfs code _is_ broken. To quote [iu.edu] 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.
      • 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.
      • 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.
    • Uh, try adding a CVS directory to /etc/rc3.d and see what happens. Things go boom in the boot, as it were.
  • by x00101010x ( 631764 ) on Monday July 19, 2004 @07:04PM (#9743224) Homepage
    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.
  • 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.
  • so:

    [user@localhost]# su
    password:
    [root@localhost]# cd /
    [root@localhost]# cvs import . -m 'my linux distro' mydistro username start
    • how'd you know my password?
    • 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!
      • 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).
  • Yes, Gentoo... (Score:2, Informative)

    by andrewdk ( 760436 )
    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.
  • by Deagol ( 323173 ) on Monday July 19, 2004 @10:24PM (#9744742) Homepage
    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?

    • 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...
  • FreeBSD (Score:2, Interesting)

    by Scythe0r ( 197724 )
    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.
  • 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.
  • sudo apt-get install changetrack
    For non-Debian users, download changetrack [sourceforge.net] 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.
  • 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.
  • 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

    ### ski

  • cfengine (Score:2, Informative)

    by bandix ( 184495 )
    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/

Many people write memos to tell you they have nothing to say.

Working...