Directory Structure – Difference Between /etc and /usr/local/etc

directory-structurefhs

I am developing a daemon that needs to store lots of application data, and I noticed that on my system (Fedora 15), there is a /usr/local/etc directory.

I've decided to install my daemon to /usr/local/bin, and I need a place for my config files.

I didn't see this on Wikipedia. Is this non-standard or is this in fact the standard place for programs installed to /usr/local/bin to store config files?

Reason being, I want to market this to sys-admins, and getting something like this wrong is not a great selling-point…

Best Answer

/usr/local is usually for applications built from source. i.e. I install most of my packages using something like apt, but if I download a newer version of something or a piece of software not part of my distribution, I would build it from source and put everything into the `/usr/local' hierarchy.

This allows for separation from the rest of the distribution.

If you're developing a piece of software for others, you should design it so that it can be installed anywhere people want, but it should default to the regular FHS specified system directories when they specify the prefix to be /usr (/etc, /usr/bin, etc.)

i.e. /usr/local is for your personal use, it shouldn't be the only place to install your software.

Have a good read of the FHS, and use the standard Linux tools to allow your source to be built and installed anywhere so that package builders for the various distributions can configure them as required for their distribution, and users can put it into /usr/local if they desire or the regular system directories if they wish.