IT Blogs & News - Written by IT Professionals - iuvo Technologies

Version control for UNIX Configurations

Written by Bryon Beilman | Nov 17, 2009 8:56:50 PM

by Bryon D Beilman

One of the best practices that we use with our own servers and our clients is version control. Most of the files in current Linux machines are "Text Files" which easily lend themselves to the use of a version control system. Even databases such as MySQL can be exported to text files which then can be managed via a version control system.

Why use version control?
I could say , "Why Not?", but a better answer is that it can be very valuable if things change and you need to revert back to the original configuration, or perhaps you need to see what changed, why and by whom. How many times have you been on a machine and found file.bak file.bak.1 file.orig file.anothercopy...etc. Using version control software can keep one file AND versions.

What files can benefit from version control?

Version control is used by software developers, but not as consistently by IT professionals. Newer commercial OS's are becoming more difficult to use with version control as it works the best with Text files. Solaris 10, and AIX utilize non-text files in some of the critical services, so they may need special consideration when using version control software.

Examples of files that can benefit from version control.

  • /etc/passwd
    /etc/shadow
    /etc/hosts
    /etc/nsswitch.conf
    /etc/resolv.conf
    /etc/auto.*
    /etc/samba/*
    /etc/ntp.conf, & /etc/ntp/*
    /etc/sysconfig/network (linux)
    /etc/nsswitch.conf
    NIS source files
    DNS zone and configuration files
    .
    .
    many more

What are my software options?

There are many free options as well as commercial options to choose from. There is RCS, CVS, Subversion and GIT.

My two favorite products are

RCS - http://www.gnu.org/software/rcs/
- This software is free, and is included in many Operating systems. It doesn't work well hierarchically (unless you buy a commercial version) It is simple and uses command such as ci (check in), co (check out), rcsdiff (shows difference between versions)....etc.

Subversion http://subversion.tigris.org/ - This software is free, is included in many Linux distributions and supports hierarchy as well as a centralized network repository. The SVN servers can use their own svnserver or utilize http with webDAV. The commands are simple (commit, update, etc) and there are some good GUI versions for windows and Mac so that heterogeneous environments can all use the same repository.

I have to admit, that without thinking, if I am going to get on a new machine, the first thing I do is to create and RCS directory and check in the files I am about to edit. Ultimately, however, if you take the time to set up a central repository, I could do the same with Subversion, but I would have to have a good place to look up and remember the server URL that should use. Whatever tool you use, version control is a good practice and you and your entire team should use it often, but like most tools, it has the most value if EVERYONE who is working on the same systems use it.