0

So by default, most services install their configuration files to /etc/<application>. On my physical systems, I'm using LVM for volume management, and specifically so I can rollback snapshots when I hose things up.

I've got a lot of custom applications installed from source that allow me to setup where their configurations are installed to and read from, but they're generally pretty willy-nilly by default - they read from $HOME, or a specific directory in their source tree, and sometimes /etc/<application>.

I was working towards fixing these so that I have them all running with configurations stored in a standard location - this could mean creating /etc/<app> myself and keeping them stored in that location (though I'm not sure if that's a bad practice for apps running from src), and it occurred to me that it would be pretty awesome if I could keep them in a subdirectory of /etc stored on a completely separate partition/logical volume, then if (for whatever reason) I need to rebuild a server, I can blow away /root keep the configuration partition, and just remount it in place, then point the services at the existing configuration files.

I did some quick digging around and found /etc/local, which appears to be made for this purpose, but I found several docs saying that I shouldn't be using that myself. That directory doesn't appear to exist on my Ubuntu 14.04 server.

Moving these to a separate partition/configuration folder would also allow me to back them up easily (I could just point rsync at the root and backup everything with a single command)/cron job).

Besides my "source installed" applications, I was thinking about trying to move my DNS/DHCP/iptables/nginx/apache configurations there as well - i.e. applications that have extensive configurations and need to be backed up, and if I rebuilt the server for whatever reason, I would want those configurations to be retained.

Edit: After looking around a little bit more, it looks like /usr/local/etc would be a good location and shouldn't cause any issues having it on a separate partition.

Any recommendations on this?

1

Look at Moving /etc to separate partition for reasons it's difficult (if not impossible) to use separate partitions for /etc or subdirectories thereof.

You might find etckeeper useful for your use-case; it allows keeping /etc in a version-control system such as git, which means you can then easily maintain a copy somewhere else with all the history.

If you're going to manage multiple machines though you should really look at centralised configuration management, with tools such as cfengine, puppet, chef, ansible...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.