I recently crashed my home server, now looking for a more efficient way to do things. I want to use a /etc in my /home/webserver directory. Which would override the normal /etc/ files.

Exemple: /home/webserver/etc/mysql/my.cnf would override /etc/mysql/my.cnf. Or, if I create a file ~/etc/nanorc, it would override /etc/nanorc etc.

How would I do that under Debian last distrib?

  • 1
    What is more efficient about that? – Kazark Apr 22 '13 at 20:58
  • Setup etckeeper. Clone your /etc repo to another location. – Zoredache Apr 23 '13 at 0:05
  • @Kazark, the ability to "clone" the settings to another box directly ? Keep manual changes separated from bundled stuff ? – DColl Apr 29 '13 at 14:56
  • @DavidColl Okay, so you aren't talking about runtime performance. Gotcha. – Kazark Apr 29 '13 at 17:18

That depends on the program doing the configuration handling. E.g. git looks for configuration data in several directories in turn, the first found is used. Other programs might just use the first file found in some order, others just use a common configuration.

You could play games with chroot and mounting your own etc in it, but that will end in a mess that makes me shiver.

Consider carefully why each program uses the exact configuration mechanisms it has (no, this isn't random; long, detailed consideration went into each), and see how to use it to your advantage, instead of trying to kludge around it.


Finally, seems there's no "magic" solution (automatic override). So I setup symbolic links to the fils I've manually modified (ie. /etc/mysql/my.cnf ==points to==> ~/etc/mysql/my.cnf).

Apache2 for exemple, will recursively look into conf directories, that makes the use of symbolic link to a directory possible. Not necessary this way to create a link for each files.

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.