5

To manage the configuration of a server, I keep some configuration flies (located in /etc) under version control (in the home folder) and then symlink to them from their /etc locations:

/etc/someprog/c.conf -> /home/ubuntu/etc-config/someprog/c.conf

Is this a reasonable approach? Any potential downsides?

Matt Sweeney
  • 249
  • 2
  • 7

3 Answers3

6

I noticed you add git as a tag--it sounds like /home/ubuntu/etc-config is a git repository with all your configs in it. In which case, it sounds like you're trying to manage configuration files from a central location. If that's the case, I highly recommend looking for a real solution.

Take a look at something like puppet, chef, cfengine, or any of the major configuration manage engines out there. Many of them are free and open source, widely used, and are typically very easy to setup and manage. If you're trying to use a "lightweight" method instead, you'll likely come to regret it later.

Andrew M.
  • 10,982
  • 2
  • 34
  • 29
  • 1
    +1 for "use a real configuration engine" – Alex Holst Nov 04 '11 at 20:08
  • fair point :) I had a feeling that might be the answer to this question. what's your config engine of choice? – Matt Sweeney Nov 04 '11 at 20:15
  • 1
    I'm partial to puppet, but there as many opinions as there are configuration management systems. :) Since a lot of them have different strengths and weaknesses, definitely try a few of them out. Most packages manages (i.e., apt) have them--so give them a whirl! Nothing will tell you if it fits like trying it on. – Andrew M. Nov 04 '11 at 20:25
3

If these are on different filesystems, then this is a very bad idea. If the other filesystem does not mount then you will have problems.

jftuga
  • 5,572
  • 4
  • 39
  • 50
0

I wouldn't use symlinks like this. If you break the link (for any number of reasons) you'll break the config. It's more appropriate to point the server/daemon/app to the actual location of the config file in the init script.

If you just want version control, look at RCS. I've actually found git to be a poor stand-alone server config solution (no locking, no permissions management, the whole directory becomes the repo). If you need something more robust for configuration management, then I'd strongly suggest taking a look at Puppet, Chef, or (gasp) CFEngine.

Aaron
  • 74
  • 3