Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Jun 2007 18:37:12 -0400
From:      "Maxim Khitrov" <mkhitrov@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: Recommendations for config file revision control
Message-ID:  <26ddd1750706011537l16b7ea86o5ae7eb25c16a7422@mail.gmail.com>
In-Reply-To: <466078C1.1050805@cs.okstate.edu>
References:  <26ddd1750706011227g224eaa1dh93233400c704595e@mail.gmail.com> <466078C1.1050805@cs.okstate.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On 6/1/07, Reid Linnemann <lreid@cs.okstate.edu> wrote:
> Written by Maxim Khitrov on 06/01/07 14:27>>
> > Hi everyone,
> >
> > I'm currently setting up a new server, and I'd like to keep track of
> > all changes made to various config files (in /etc, /usr/local/etc, and
> > a few other places perhaps). My first thought was to setup a
> > subversion server which would contain the partial directory structure
> > that matches that of the server's starting at /. It would contain
> > versioned copies of all the configuration files that I want to keep
> > track of in their appropriate locations. What I would do then is write
> > a hook for subversion that will issue an automatic export command
> > (don't want .svn directories everywhere) every time a commit is made
> > to the repository. So to edit some configuration file I would first
> > checkout a working copy of the repository to some other location, make
> > the change and commit it. The server would be automatically updated
> > with the new file and I would be able to keep track of every change.
> >
> > This seems like a decent strategy to me, but before I go off writing
> > the scripts and setting up the server I wanted to ask what you guys
> > might be using to keep track of the server configuration (backups
> > don't count)? Is there an easier way of doing the same thing, for
> > example, eliminating the need to do a working copy checkout first?
> > Perhaps a way to monitor certain files for changes, and automatically
> > commit them every time a change is saved. I'd be glad to hear any
> > suggestions you might have in this regard. If possible, I'd like all
> > the versioned files to contain an id string, so that it's easy to
> > determine when the file was last changed and by whom, but this is
> > optional. For the most part I just need a way of going back to
> > previous versions.
> >
> > Thanks,
> > Maxim Khitrov
>
> You might consider avoiding the excess labor of SVN and use RCS, since
> you're just tracking changes for individual files in place on one host.
> man rcsintro to see if this is more suitable for you.
>

Hm... I think that while SVN would require more work initially, RCS
would probably be more maintenance. The main problem I see is the
requirement to execute commands on the server after each modification.
This may not be always possible. With SVN I have a local copy of all
the files, so as long as I'm able to commit I don't need to actually
be logged in to the server.

See my ideal solution would be to open a file via sftp, for example,
make the change and upload it. The change is detected, the Id string
is updated, and the old revision is saved. SVN is one step away from
that because I need to checkout a working copy first. Also, I couldn't
do all this directly on the server by just opening vi and editing the
file. This solution, however, would require some sort of monitoring.
I'm even considering writing a simple C app that would use gamin to
track when versioned files have changed, but I don't know how well the
whole thing will work. With too many files I'm afraid that this
monitoring would put too much unnecessary load on the server. An
alternative is to keep the server configuration files just as they
are, but checkout a working copy of the repository on the server. Then
a cron script could compare the two directory trees, checking contents
of the files. If one changes, update the other one. Again... seems
like too much work for something that should be rather simple in my
opinion.

I'll look a bit more into RCS, but it doesn't look like it offers
anything major over subversion. Any other ideas?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?26ddd1750706011537l16b7ea86o5ae7eb25c16a7422>