Slashdot Mirror


Version Control for Important System Files?

TokyoCrusaders92 asks: "Like a lot of other organizations (800 staff, 5000 students) we have a mix of Windows, Novell & Linux (primarily Linux) for our IT infrastructure. We now have a multitude of config files, firewall rule bases, shell scripts, and so forth which are managed by multiple people and groups. Recently, we started using RCS for version control of the firewall rule-base, but this doesn't seem like it would scale up to larger groups of users. While thinking about this, it would seem that the critical features would include: version control; logging; multiple users; secure authentication; and integrity checking. What are other people using to manage their config files?"

71 comments

  1. Notepad by Timesprout · · Score: 4, Funny

    What more could you possibly need?

    --
    Do not try to read the dupe, thats impossible. Instead, only try to realize the truth
    What truth?
    There is no dupe
    1. Re:Notepad by smallfries · · Score: 3, Informative

      GP uses a humorous post. Technical criticism is not applicable and is thus useless.

      --
      Slashdot: where don knuth is an idiot because he cant grasp the awesome power of php
    2. Re:Notepad by Timesprout · · Score: 1

      My faith that Slashdot is not populated by humourless pedants is restored.

      --
      Do not try to read the dupe, thats impossible. Instead, only try to realize the truth
      What truth?
      There is no dupe
    3. Re:Notepad by fbartho · · Score: 2, Funny

      Mine wasn't, I forgot to use version control.

      --
      Gravity Sucks
  2. Distributed SCM by MichaelSmith · · Score: 2, Informative

    I keep my config files in a directory structure in my home directory on my laptop which mirrors the structure of the systems I maintain. I use the mercurial DSCM for version control and push revisions to a user account on each server. From there I run a script as root which recursively copies the files into the target directory tree.

    1. Re:Distributed SCM by Breakfast+Pants · · Score: 1

      If you have to handle different files for different machines, I'd reccommend Oracle's opensource cvsman

      --

      --

      WHO ATE MY BREAKFAST PANTS?
  3. A CVS server by kotj.mf · · Score: 4, Informative

    How similar are your systems? I help manage several thousand distributed boxes that are reasonably identical, and we keep everything in a central CVS server: management scripts, config files, crontabs, what have you. There's no reason it couldn't be used for more heterogeneous systems, other than having to be more careful with file naming conventions.

    --
    hang brain.
    1. Re:A CVS server by tzanger · · Score: 2, Interesting

      I tried CVS for that... it is too much of a pain in the ass to patch CVS to accept root users. I don't know about you, but screwing about with permissions just to appease CVS was not my idea of fun. Maybe next time I'll run svn or something to see if it works better for config file management.

    2. Re:A CVS server by jgrahn · · Score: 1

      I tried CVS for that... it is too much of a pain in the ass to patch CVS to accept root users.

      I manage /etc on all my boxes with CVS, and I see no such problems. The CVS used is various versions, plain and unpatched (except by Debian).

  4. Subversion by Just+Some+Guy · · Score: 2, Informative

    Next question?

    --
    Dewey, what part of this looks like authorities should be involved?
    1. Re:Subversion by Threni · · Score: 1

      > Next question?

      Can we have version control in the file system, please? That way we'd *never* accidentally delete/change files, have them corrupted by viruses/hackers etc. You could label all your files each time you boot up. Perhaps for speed there'd be some files you'd not bother with (swap file, registry, temp files for some apps) but generally it would be pretty cool.

    2. Re:Subversion by maxwell+demon · · Score: 1

      Can we have version control in the file system, please?

      It seems so.
      --
      The Tao of math: The numbers you can count are not the real numbers.
    3. Re:Subversion by Cyberax · · Score: 3, Informative

      Subversion is the ideal solution - because it needs a lot of junk in .svn directories :( And it can mess with some scripts that do recursive grep or something similar.

      SVK is better, but it is not as widely supported as SVN.

    4. Re:Subversion by Just+Some+Guy · · Score: 1

      Subversion is the ideal solution - because it needs a lot of junk in .svn directories :( And it can mess with some scripts that do recursive grep or something similar.

      That's true, but in practice is that such a huge problem? We use SVN already for all project code and have managed to make do with it. If you can grep and operate on a few megs of in-house development source, a comparatively tiny /etc directory shouldn't be too much hassle.

      SVK is better, but it is not as widely supported as SVN.

      That's a huge consideration, though. SVN is cross-platform, and both servers and clients are available for pretty much any system. It's there and it works, and there's a good chance you're already using it somewhere. Why not take advantage of that shiny repository for other important systems?

      --
      Dewey, what part of this looks like authorities should be involved?
    5. Re:Subversion by chris_eineke · · Score: 1

      because it needs a lot of junk in .svn directories :(
      And CVS doesn't?

      And it can mess with some scripts that do recursive grep or something similar.
      And CVS doesn't? tar has --exclude=CVS or --exclude=.svn and -- are you surprised yet by the UNIX way? -- so does grep.
      --
      "All you have to do is be fragile and grateful. So stay the underdog." Chuck Palahniuk, Choke
    6. Re:Subversion by Cyberax · · Score: 1

      Grep doesn't have a problem with /etc size, but .svn directories store the pristine copies of controlled files. So you'll get TWO matches instead of one.

      SVK is built on top of SVN and written in Perl. It works pretty much everywhere, but you don't get nice GUI clients for it.

    7. Re:Subversion by Cyberax · · Score: 1

      Why do you think that I'm protecting CVS?

      I don't like --exclude because it leads to more typing and also can lead to errors if you forget to add it.

    8. Re:Subversion by Anonymous Coward · · Score: 0

      There are more version control systems than CVS and SVN.

    9. Re:Subversion by ceroklis · · Score: 2, Informative

      RTFM: that is what the export command is for.

    10. Re:Subversion by Cyberax · · Score: 1

      I know about 'export' (I've been using Subversion since 0.24 alpha, AFAIR :) ). But usually you need to tweak something directly inside /etc, check if it works and then commit the fix to repository.

      Exporting and importing changes to working copy leads to more errors (if you forget to delete a file from repo, etc.).

    11. Re:Subversion by chris_eineke · · Score: 1

      can lead to errors if you forget to add it.
      But that's an universal truth. If I forget to pull down my pants to take a dump, I will crap my pants. :-)
      --
      "All you have to do is be fragile and grateful. So stay the underdog." Chuck Palahniuk, Choke
    12. Re:Subversion by xlv · · Score: 2, Interesting

      Subversion is the ideal solution - because it needs a lot of junk in .svn directories :( And it can mess with some scripts that do recursive grep or something similar.

      That's true, but in practice is that such a huge problem? We use SVN already for all project code and have managed to make do with it. If you can grep and operate on a few megs of in-house development source, a comparatively tiny /etc directory shouldn't be too much hassle.

      I've been using svn for a few years now for projects and system files. There's a few problems with the .svn directories for system files. For instance, modprobe on Linux will check and complain about the files in /etc/modprobe.d/.svn when they are parsed.

      As explained by somebody else, using the export command is not that useful as then /etc is not directly under revision control and that opens the door for synchronization errors.

    13. Re:Subversion by Cyberax · · Score: 1

      Yet one more reason not to wear pants :)

      And, personally, I prefer to minimize number of 'failure points' in my workflow. I take Murhpy's laws very seriously.

  5. puppet... maybe (not yet at least) by getha · · Score: 3, Informative

    Using something like subversion or any other version control system for such a task just leads to Yet Another Homebrew Administration System, that will probably lead your successors to tears and insanity. Use tools already there, and that are pertinent to the job.

    version control; logging; multiple users; secure authentication; and integrity checking. All those features you need are mostly already there in puppet: http://puppet.reductivelabs.com/ (and maybe also in cfengine, but that's a nightmare). And the development on puppet is really picking up steam at the moment.

    Problem for your situation is that it has no Windows or Novell support as of yet, but recently work on Windows at least seems to have started. And if your first priority is mainly config file management: that part should be fairly trivial.


    --


    xchg .,@
    jmp emailMe
  6. Our system is great by Heir+Of+The+Mess · · Score: 5, Funny

    We have a login script that calls another script that is the one that gets modified. To use different script you just change the name of the called script to the one you want. If the script gets changed then the person who changed it changes the name and we can tell how old it is by the date stamp on the file. So far we have these (oldest to newest):

    sublogin.bat
    sublogn2.bat
    sblg2fix.bat
    latestlg.bat
    newlatst.bat
    finalfix.bat
    reverted.bat
    fixwrked.bat
    NtOnMyPC.bat
    WksOnMyn.bat
    NTONMYPC.bat
    TryThis1.bat

    Seriously though, subversion is good because it lets you do atomic checkins.

    --
    Australian running a company that does C# / C++ / Java / SQL / Python / Mathematica
    1. Re:Our system is great by 26199 · · Score: 2, Informative

      How in the world did this get modded interesting?

      It should be clear to anyone that you were being sarcastic :p

  7. Those who don't know VMS... by MrBoombasticfantasti · · Score: 3, Informative
    Those who don't know VMS are wont to re-invent it... ;-)


    See Files-11 for a flashback.

    --
    !ERR: Signature not found.
    1. Re:Those who don't know VMS... by bill_mcgonigle · · Score: 1

      Those who don't know VMS are wont to re-invent it... ;-)

      ZFS seems to be headed in that direction, though I've seen bickering about how it would be exposed. No ;1, though, please. ;)

      --
      My God, it's Full of Source!
      OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
    2. Re:Those who don't know VMS... by morgan_greywolf · · Score: 1

      Unfortunately, ZFS can only be used on Linux through FUSE. 'Real' kernel module support for ZFS on Linux is not possible due to several Sun patents and the fact that the ZFS code is CDDL, which is incompatible with the GPL.

    3. Re:Those who don't know VMS... by bill_mcgonigle · · Score: 1

      Real' kernel module support for ZFS on Linux is not possible due to several Sun patents and the fact that the ZFS code is CDDL, which is incompatible with the GPL.

      Fortunately OpenSolaris will be licensed GPL3 soon (at least that's the word on the street).

      I'm not sure what happens when you try to use GPL3 code in a GPL2 product like Linux. I'd have to guess the FSF has that covered, but I'm not sure. The patent part should be covered regardless.

      Now that I think about it, Patents + GPL3 is a nice way for companies to contribute to Open Source - it saves us from having to worry about Microsoft, Verizon, and Unisys patenting something that's already been in use for a while.

      --
      My God, it's Full of Source!
      OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
    4. Re:Those who don't know VMS... by Anonymous Coward · · Score: 0

      I'm curious about your patent concerns. How were Apple and FreeBSD able to incorporate ZFS into their OSes?

  8. Case insensitivity? by mosel-saar-ruwer · · Score: 1


    NtOnMyPC.bat
    WksOnMyn.bat
    NTONMYPC.bat

    Do not M$FT file systems tend to be case insensitive?

    1. Re:Case insensitivity? by Heir+Of+The+Mess · · Score: 1

      The command line and shell are case insensitive, but the names are still saved with the case that you typed in.

      --
      Australian running a company that does C# / C++ / Java / SQL / Python / Mathematica
    2. Re:Case insensitivity? by Woy · · Score: 1

      Hence you can't have 2 filenames differing only in capitalization??

      --
      "If God created us in his own image we have more than reciprocated." - Voltaire
    3. Re:Case insensitivity? by Heir+Of+The+Mess · · Score: 1

      Hence you can't have 2 filenames differing only in capitalization??

      Just tested trying to create Test.bat and test.bat in the same directory in Windows XP using the "Explorer" shell, and yes I couldn't create the second file - said the name already existed.

      --
      Australian running a company that does C# / C++ / Java / SQL / Python / Mathematica
    4. Re:Case insensitivity? by jdray · · Score: 1

      AFAIK, there's a system-wide switch for later versions of Windows (post W2k?) that enforces case sensitivity. Don't care, though; I use a Mac.

      --
      The Spoon
      Updated 6/28/2011
    5. Re:Case insensitivity? by Heir+Of+The+Mess · · Score: 1

      Yeah you have to add this value to the registry:

      HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Cont rol\Session Manager\kernel

      "obcaseinsensitive"=dword:00000000

      Which is what you need to do if you are running Services For Unix

      --
      Australian running a company that does C# / C++ / Java / SQL / Python / Mathematica
    6. Re:Case insensitivity? by Anonymous Coward · · Score: 1, Insightful

      HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Cont rol\Session Manager\kernel

      "obcaseinsensitive"=dword:00000000


      What an abortion the Windows registry is! If MS followed the *nix philosophy, the setting would be in an /etc file with a simple setting called

      case_sensitive = false
      This would of course be fully documented in a clear, informative man page.
  9. Add another box.... by williamyf · · Score: 2, Insightful

    Get an "Industry Standard OpenVMS" (that the name HP gives to that beast) and use it as your main file server and config info repository. All the features you desire are there by default.

    While this response was accurate from the technical point of view, it was meant to be a joke

    --
    *** Suerte a todos y Feliz dia!
  10. rsnapshot by perlionex · · Score: 3, Informative

    I use rsnapshot to do version control of my entire system. From the description:

    rsnapshot is a filesystem snapshot utility for making backups of local and remote systems.

    Using rsync and hard links, it is possible to keep multiple, full backups instantly available. The disk space required is just a little more than the space of one full backup, plus incrementals.

    Personally, I configure rsnapshot to generate snapshots every 4 hours, and then daily, weekly, and monthly.

    In your case, since you only want versioning for your configuration files, you can point rsnapshot at just the configuration directories (probably just /etc).

    1. Re:rsnapshot by hattmoward · · Score: 3, Insightful

      Those are snapshots, not versions. It is possible for a particular revision of a file to roll off your monthly rotation and be forgotten forever.

  11. One idea for Windows and Unix (shameless plug) by DNAGuy · · Score: 2, Interesting

    For Windows, the default answer for deploying configuration is Group Policy. With the Group Policy Management Console you can back up your GPOs and store them in your version control system. Alternatively, you can use a specialized Group Policy version control and troubleshooting product like Group Policy Manager from Quest which allows offline editing and testing before deployment to your production environment.

    You can actually extend Group Policy to your *nix and Novell machines as well using Vintela Group Policy (a part of Vintela Authentication Services), which also has features to allow your *nix machines to use your Active Directory accounts. If you use it in combination with Group Policy Manager, you can back up the *nix specific settings alongside the rest of your GPO. Also, the integration allows you to diff different versions of your *nix settings alongside the rest of your GPO.

    [Disclaimer: I am a developer on the Group Policy Manager team at Quest. While I'm proud of my product, I'm not any kind of official spokesperson for my employer.]

    --

    BRENT ROCKWOOD, EST'd 1975

  12. rcs by pe1chl · · Score: 4, Interesting

    On systems where it matters, I keep config files etc in RCS.
    In each directory where config files live that I want to keep, I create an RCS directory and rcs -i the file(s).
    Nightly, I job runs that finds all files for which an RCS entry exists and that are newer than that entry, and a copy is checked in.

    No need to think about checking in/out all the time, no problem that the RCS seems to believe that you don't want to keep the actual file around.
    It does not save every edit but at least I have a copy of each day's state of the file.

    1. Re:rcs by Anonymous Coward · · Score: 0

      Nice. I was going to suggest RCS with rsync for centralization by hostname.
      Combine this with http://freshmeat.net/projects/linuxsysteminfo/ System Info or something similar and life is good.

      Config files aren't all you need. Those pesky customized startup scripts and custom kernel builds are also important.

  13. WSUS for system updates by Joe+The+Dragon · · Score: 1

    will be a big help

  14. Darcs by swarsron · · Score: 2, Informative

    Try darcs (http://www.abridgegame.org/darcs/). Should do everything you need and has the advantage that you can create multiple repos for different purposes which all base on a single base repository. So i have a repository with all my config files and several others for different users which can pull their changes on top of the standard stuff. The syntax is quite easy to learn too.

    Only drawback is that it is quite slow with really big repositories (e.g. linux kernel).

  15. Use SVN instead by Schraegstrichpunkt · · Score: 2, Informative

    For a new installation, Subversion is probably a better choice than CVS, mainly because changesets are committed atomically, directories are versioned, and it has better security when dealing with remote access.

    1. Re:Use SVN instead by Anonymous Coward · · Score: 0

      For a new installation use something else. In 2007 we have options that beat SVN and CVS in just about any scenario. SVN is good for people migrating from CVS and that's about it.

    2. Re:Use SVN instead by Anonymous Coward · · Score: 0

      Care to share, rather than blather?

    3. Re:Use SVN instead by Steve+Folta · · Score: 1

      He'd be talking about things like Git, Mercurial, Darcs, Monotone, Bzr... See http://en.wikipedia.org/wiki/List_of_revision_cont rol_software. VCS's have made great strides in the last couple of years (probably due to the well-publicized needs of the Linux kernel). I'm really surprised that most of the comments here keep talking about obsolete systems like Subversion.

  16. svn trick by bluegreenone · · Score: 4, Informative
    I use subversion (and tortoisesvn as the client) to version my windows system files, in general it works well. There is a trick though. To get a directory under svn control you normally have to import that directory and then rename it so you can checkout an svn'ed copy under the same name. This can be a problem for certain system directories. In this case what you do is :
    1. create the dir in the repository but leave it empty
    2. checkout that url on the existing dir, since url is empty nothing is overwritten
    3. now do an svn add then commit to get everything into the repository
    This leaves you with a versioned dir without need for renaming or deletion

    ...
    PATH train schedule online

    1. Re:svn trick by barzok · · Score: 1

      Not sure I'd call something that's well-documented in the FAQ a "trick."

    2. Re:svn trick by trawg · · Score: 1

      Awesome trick! Very handy stuff.

  17. This is my solution.. there are many like it, by way2trivial · · Score: 1

    this one is mine.
    I use vice versa pro
    http://www.tgrmn.com/ disclaimer, I'm just a customer

    It lets me sync files across different directories.. and if it finds changes, it has an option to archive a copy of what was there before in a third directory, with a date/time stamp.

    you can set it to retain X# of copies, or for x# of days.. I have it set to automatically run on any change in the
    mydocs folder on my pc at work, or my pc at home.. if I open a file at home and modify it, I can rest easy knowing the chages will be there on my work pc the next day, and if I screw up, I can go to the archives...

    I can set the bandwidth limit so as to not drown out my point to point connection (the work connection is commercial account cable modem, and also supplies my workplace website)

    --
    every day http://en.wikipedia.org/wiki/Special:Random
  18. CVS by Colin+Smith · · Score: 1

    Config files are trivial to manage in CVS, it doesn't really need anything more sophisticated. You could probably get away with RCS but it'd be more hassle.

    --
    Deleted
    1. Re:CVS by Anonymous Coward · · Score: 0

      Compared to RCS, CVS has extra configuration and tons of features irrelevant here.

      (CVS has been developed as a layer on top of RCS)

  19. svn by ManiaX+Killerian · · Score: 1

    As a lot of people suggested - SVN, one repository per type of server (so you can merge changesets even internally, although using diffs is also easy), the only problem we've got is that everyone uses root@ on that machine, and the repository is checked out by servername@svn-server, so everyone has to write his name when commiting changes. If it was possible to auth users based on ssh keys on the svn server, it would be perfect.

    1. Re:svn by penfern · · Score: 2, Insightful

      I do not prefer SVN over httpd (as their website seems to recommend). I always go for it straight through ssh. Much simpler and easier to manage, as long as all your users are already ssh users.

      So yes, you can easily use ssh identities, or none at all and they have to type in their username/password every time. :)

  20. Whatever you do by JamesP · · Score: 1

    don't waste your money on "Enterprise CVS solutions" that suck donkeys balls (the more expensive, the crappier it is, pretty much all of them).

    They will gladly charge an arm and a leg for something as good (or worse) as CVS

    Yes, I think you're thinking what I'm thinking and it is beyond me why people pay so much money for that crap. Probably because in their minds expensive == good

    --
    how long until /. fixes commenting on Chrome?
  21. You need ClearCase by Anonymous Coward · · Score: 0

    Yup, definitely ClearCase. With UCM. It will make you forget about all of your current problems.

    After you sign the huge check$ and the army of IBM consultants have left you will spend so much time dealing with cryptic errors, frantic users, and merge problems that you will have totally forgotten any problems you now have.

  22. cfengine by eviltypeguy · · Score: 3, Informative

    One word: cfengine

    http://www.cfengine.org/

    1. Re:cfengine by nebulous_afterthough · · Score: 1, Insightful

      CFEngine is great for distribution and synchronization. It's not a version control system. In concert though, CFEngine with CVS is a great way to manage a lot of systems. You can even manage the CFEngine configuration within CVS for optimal control. Makes release management feasible and sane.

    2. Re:cfengine by doug · · Score: 2, Insightful

      I like that you're thinking outside of box. Every post I've read has tied replication with revision control. You're right that cfengine would do a great job of replicating the config files, but that doesn't remove the need for source management. At least one machine will still need rcs/svn/clearcase track the originals.

      - doug

  23. Break the problem down by lamber45 · · Score: 1
    If you already have hundreds of heterogeneous systems, you don't want to add another authentication system, another logging system, and a whopping security hole. Better to see if existing tools can do the job, as much as possible.

    I've been thinking about doing a project like this. I would probably use rdist+ssh/nfs/samba to copy the files to a central host, and run a cron job that calls a Perl script to check in changes regularly, only if something has changed; perhaps along with selections from the logfiles of the machine where the change happened. I would probably use SVN as the version-control system. However, those are the just the tools that I'm most familiar with; I'm sure many other tools could be used to accomplish this task.

  24. That's pretty a high staff/student ratio by Anonymous Coward · · Score: 0

    Our staff student ratio is 400/6000. Perhaps you could fire the 200 or so IT dudes it takes to babysit all those linux boxes and deploy Windows.

  25. Re:This is my solution.. there are many like it, by Anonymous Coward · · Score: 0

    The functionality seems good, but that's the most ugly and inconsistent UI I've seen in a long time! Check out the screenshots page for at least 3 or 4 different styles of buttons and colour schemes. If they could polish the UI to make everything consistent, and perhaps use a manifest to use the XP theme, it could be very nice indeed. As it stands it looks like something my boss would knock up in VB as a prototype. *shudders*

  26. Easy. by Slashcrap · · Score: 1

    Simply write a script that runs MD5sum on every file in the filesystem once per minute and then copies any that have changed over the network to a central VMS server (which will take care of the versioning for you).

    That's what you get for not listing cost effectiveness or efficiency amongst your requirements. Be more careful in future.

  27. SVN for Configuration Management by desertcrevasse · · Score: 1

    First, some points about what would motivate a decision for Subversion:

    - Revision control (Which includes all the things you do in software engineering: tagging, branching, merging, diffing, patching.)
    - Excellent cross-platform support
    - Several choices for client connectivity. HTTP(S)/mod_dav and SSH are the most popular.

    That said, Subversion is NOT just for managing traditional software projects. There are many other types of controlled resources that require the features above. In our case (a large University), we use Subversion to manage our builds of the applications that _run_ our software. Our builds of Tomcat and JBoss are tightly controlled, and we use revision control techniques to manage them. Diffing files from a new release against our trunk, merging vendor changes, and branching configurations for different environments are common practice.

    Subversion is an excellent tool for software configuration management.

    M

  28. /etc under SVN control by SCY.tSCc. · · Score: 1

    About 2 years ago, we've introduced SVN to check in and keep control over our config files in /etc on our rootserver.

    It allows us to see when, what and - given the administrator provided this information when the file was committed - WHY changes have been applied. That's pretty important in an environment, where up to 9 administrator have access to the files.

    Saves you from losing precious configurations and allows for easy rollback if a certain configuration change doesn't work. You can even use your config on more than one server. Use branches and switching files for configs that are host-dependant.

    On the downside, this system only works if all administrators commit their files immediately after the change and document the reason for changing.

    bye,
        Settel

    1. Re:/etc under SVN control by commonchaos · · Score: 1

      When I was thinking about doing something like this, my idea was to put the editor commands in a wrapper script which would launch the editor and do a 'svn ci' after the editor exits.