RCS for managing config files

Tom Metro blu at vl.com
Sun Apr 15 16:52:06 EDT 2007


Matthew Gillen wrote:
> Tom Metro wrote:
>> That's what RCS is for.
> 
> RCS wouldn't help you in that situation, specifically when there is a single
> copy of a file that multiple people are editing.  Each person would
> overwrite other people's changes with each save.

That's precisely what RCS prevents. The first person to check out and 
lock the file has exclusive write access until they unlock it.

Where RCS tends to fall short in a sys admin context is that the kind of 
files you want to manage tend to be owned by root, and thus the people 
working on them are either running as root or using sudo. Either way, 
this trashes RCS's user model.

If everyone is consistently using sudo, it should be possible to create 
a modified set of RCS commands (perhaps with wrapper scripts) that grabs 
the authentication information from the environment ($SUDO_USER). Weak 
security, but when everyone involved has root access, a cooperative 
scheme is adequate. If this is done right, you'll even have changes in 
the RCS log attributed to the correct user.

All of this could be wrapped up in an edit script that reduces the 
checkout, lock, edit, checkin, unlock, checkout cycle to one command, 
much as there are scripts for editing /etc/passwd.

On systems I maintain myself, I just keep the files in a perpetually 
checked-out and locked state, and then do 'ci -l file' after edits to 
log the changes.

  -Tom

-- 
Tom Metro
Venture Logic, Newton, MA, USA
"Enterprise solutions through open source."
Professional Profile: http://tmetro.venturelogic.com/

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




More information about the Discuss mailing list