Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
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
add comment

2 Answers

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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