With all of this setup done, it is finally time to make use of this configuration management infrastructure.Doing so is pretty easy — work as you normally do when installing packages and making changes to configuration files.Besides, that oral history tradition is difficult to maintain and harder to sustain as the number of machines grows.
What we do instead is patch into a hook of the ’emerge’ command that will save a sorted copy of the world file into /server-rcs.This patch goes into Every time ’emerge’ goes through the ‘setup’ mode when installing a package, it will run this sort command.(As you do so, you also have the added safety net of The first line will show you the files modified since the last check-in &mdash hopefully only the files you intended to modify, although this is a good point to check to make sure an inadvertent change didn’t happen. Not only to you have your brief description of what you did but you also have the exact changes made to the configuration files.The second line will copy changes to the /server-rcs directory into the RCS along with the free-text note describing why you made the change. If a change doesn’t work out, you have easy access to past configurations that allow you to revert back to a previous state.The first step is to put the system configuration files into a revision control system (RCS).
An RCS allows us to track the history of files by storing information about changes such as the date/time a change was made, what the change was, who made it, and a free-text field explaining why the change was made.(Note, though, that we’re not saving actual applications in the RCS — you may have to recompile and install older versions of applications to get back to the previous state.)We can make our system management lives even easier by using the semi-automated tool Gentoo Linux Cron Update (GLCU).This script breaks up the process of updating packages into two pieces.Our servers are generally configured with few filesystems, so in many cases the files we need to track in the RCS are within the same filesystem and we can use hard links to put them into the /server-rcs directory.Another alternative is to write a cron job to copy configuration files into the /server-rcs directory, but then realize that this kind of revision control is one way — if we restore a previous version of a file from the RCS, we need to manually copy it back to the original location.(On the other hand, using the mount ‘bind’ method is a form of self-documenting the otherwise invisible hard links to files in the same filesystem.RCS systems are common for software development shops as a way to track changes to source code.