-*- mode: indented-text; mode: auto-fill -*- file: etc-in-cvs.txt Time-stamp: <2002-08-09 12:17:53 roel> These are some tips to put your /etc directory under CVS control. This is not trivial because CVS does not preserve ownerships and permissions. Neither does it save symlinks gracefully, and this although this procedure leaves them intact, files 'under' a symlink don't end up in CVS. Putting /etc in CVS: * make backup (Surprised?) * log in as root via su (cvs doesn't allow root commits if you're directly logged in on the console. This is NOT a security precaution as some people on the CVS discussion list would have you believe. It's only for log purposes, see src/commit.c in the CVS sources.) * cd to /etc. It's a good (but not mandatory) idea to prepare on or more .cvsignore files here. Suggestions for their contents are at the bottom of this manual. * Issue the following commands, adapted to your situation of course: cvs -t -d /usr/local/cvs import -ko -m 'First /etc checkin' etc mymachine etc-initial >/tmp/errs 2>&1 # Replace /usr/local/cvs by your CVSROOT # Check errs for inadvertently ignored files! (grep ^I) # It's better to have keyword expansion turned off (-ko). * The next step is an intermediate checkout: cd /tmp # Do NOT check out directly in /etc! Never! cvs -d /usr/local/cvs checkout etc cd etc # NOT slash etc! tar cf ../cvs.tar `find . -name CVS` * And then, we put the CVS subdirs in their final destination: cd /etc tar xf /tmp/cvs.tar # To be sure, this should shut up: cvs -nq update Done! Be prepared that some utilities which scan a whole directory, e.g. for scripts to run, sometimes get confused by the presence of a CVS subdirectory. Most of the time, this is not fatal, just annoying. I mean to recall PAM does this with the pam.d directory, but I'm not certain. Also /etc/skel is copied recursively by user creation utilities, leaving the poor new user with a CVS subdir in his homedir. You may want to put 'skel' in the .cvsignore file. From now on, you can simply 'cvs add' new files. Be careful if you want to restore (cvs update) a file that was inadvertently deleted; you should check if ownership and permissions are correct after that. Suggestions for files to be cvsignored on a Redhat system (don't copy this blindly, besides cvsignore cannot contain comments): /etc/.cvsignore ld.so.cache # generated mtab # generated adjtime # generated aliases.db # generated locale # updated annoyingly often linuxconf # is itself a CVS tree amandates # generated by Amanda /etc/X11/.cvsignore applnk # updated too often and pretty pointless in CVS, IMO /etc/mail/.cvsignore *.db # generated by sendmail