betabug... Sascha Welter

home english | home deutsch | Site Map | Sascha | Kontakt | Pro | Weblog | Wiki

22 June 2006

Using RCS for Config Files

But I didn't change anything!

Using rcs to keep track of changes in configuration files is a great idea... that sometimes helps me to recover from my own stupid mistakes mucho faster. I must admit to my own shame that I managed to kill my employers web site for a day or so - it was noticed today. To my defense I should say that I immediately suspected myself and went on to solve the problem right away. "What have I changed at the config?", I asked myself. And the answer would be "Nothing" - as usual. Which of course is the wrong answer, as bit rot doesn't kill a web server so fast...

Fix one, break another

I remembered I had solved another problem where a regular expression for the "Learning Zope in Greece" blog was slightly wrong. Now in normal circumstances I'd start to dig around that change and try to find what I had trampled on. But I had a quicker way to figure it out, I just looked at my changes with rcsdiff. After a short look I figured out that I had mistakenly erased one line after the fix.

A habit of looking back

It's been many years now that I have started the habit to follow changes to configuration files with rcs. I've heard other people use cvs for that, but with cvs the problem is the creation of the "module" of sources, cvs doesn't really like this stuff to remain in place. There are some workarounds for that, but I never felt confident enough to let them play with all of /etc. On the other hand the ability of keeping all of /etc in one cvs module would be nice, so I could compare all changes in there at once. For now I'm adding files to rcs whenever I change them.

Details of use

With rcs the procedure is simple: Make sure there is a directory called "RCS" in the directory where the config lives. Then (preferably before changing a config file), I check it into the rcs repository with the command ci -l filename, which also "locks" it. rcs needs locking (unlike cvs), which sometimes complicates things. But especially with config files that are always edited by the same user account, it's never a problem, just keep the file always locked. When there are more changes, I can check what I did with rcsdiff filename, then add those changes again with ci -l filename. That's basically all I do to get my safety net. rlog filename gives me a list of changes (with my comments) and rcsdiff -r1.4 -r1.5 filename lets me see the difference between some edits.

Posted by betabug at 22:13 | Comments (1) | Trackbacks (0)
ch athens
Life in Athens (Greece) for a foreigner from the other side of the mountains. And with an interest in digital life and the feeling of change in a big city. Multilingual English - German - Greek.
Main blog page
Recent Entries
Best of
Some of the most sought after posts, judging from access logs and search engine queries.

Apple & Macintosh:
Security & Privacy:
Misc technical:
Athens for tourists and visitors:
Life in general:
<< World Refugee Day | Main | Note to People who follow RSS >>
Re: Using RCS for Config Files

I've been using CVS for maintaining config files from 10+ machines for a couple of years. The only issue I can think of on top of my head with this system is that when you have multiple identical machines that need to share config files. A directory per machine is not optimal since you need to "cp" the file from directory hostA to directory hostB, commit it there then push it to hostB. I need to find a way of grouping identical machines together in a directory or module. Thing is, you don't have identical machines from the start. You have one than sometimes after that, you decide to acquire a second one and so on.

Posted by: Saad at June 23,2006 10:44
You can trackback to:
There are no trackbacks.