4

I'm considering hardlinking config files into a working copy of my SVN config repository. Is there any reason why not to manage config files this way?

Assume /home/user/confmgr/confs is a working copy of my config repository. Then I could hardlink config files as follows-

ln /etc/php.ini /home/user/confmgr/confs/php.ini
ln /etc/httpd/conf/httpd.conf /home/user/confmgr/confs/httpd.conf

Then when I need to edit a config file it's this simple

cd /home/user/confmgr/confs
vi httpd.conf
/sbin/service httpd configtest
/sbin/service httpd graceful
svn commit -m 'adding virtual host to httpd.conf for new project'
Andrew
  • 456
  • 3
  • 8

3 Answers3

6

A few observations in almost reverse order:

  1. Why not symlink instead?
  2. Consider turning your workflow around. Safely make your changes to a second working copy, review and commit, then svn up the working copy in live use.
  3. There are more sophisticated tools to manage complex config structures from version control. Consider using Puppet, BCFG2, etckeeper and so on.
Dan Carley
  • 25,189
  • 5
  • 52
  • 70
3

I wouldn't put them in /home

Place the config files somewhere in the root filesystem.

This is because / is mounted before the other filesystems and there is a chance it might need config files that are located on a not yet mounted filesystem.

I would also use symlinks and not hardlinks. Cross filesystem hardlinks aren't allowed (iirc) and you might get broken links when you check out updated files from SVN (changing inodes).

You'll need to be very careful but I can't see a reason why you can't run with this config.

Garry Harthill
  • 864
  • 1
  • 11
  • 17
1

etc-keeper is probably a good reference design for you:

etckeeper is a collection of tools to let /etc be stored in a git, mercurial, darcs, or bzr repository.

It stores the repo in /etc/.$RCS, but it doesn't support SVN. I'm not sure why; the author merely states he tried it and it sucks. Essentially, this approach makes /etc the working copy.

jldugger
  • 14,122
  • 19
  • 73
  • 129