I'm working on a FHS2-conforming application that used to store data in $sharedstatedir
(i.e. $(prefix)/com
, e.g. /usr/local/com
).
This directory is no more in FHS 3.0, and it seems that we need to start using either
-
/var/lib
, which should storeVariable state information
or more verbosely,
state information pertaining to an application or the system. State information is data that programs modify while they run, and that pertains to one specific host.
or
-
/var/local
, which should storeVariable data for
/usr/local
(No more information is given about
/var/local
.)
Which one of these should we use?
Bonus question: Is there a variable for /var/lib
/ /var/local
, similarly to sharedstatedir
and friends that we should use, or should we simply hard-code the path into our makefiles?
Best Answer
You should choose
/var/lib
./usr/com
does not exist in FHS 2.3 or FHS 3. FHS 2.3 FHS 3.0sharedstatedir
is a concept in GNU autotools and GNU coding standardsGNU and freestandards.org do not always align.
The issue you mention came up in a 2006 mailing list post. In the case of Red Hat, the conclusion was to use
/var/lib
Technically, if you're working on an open source project that defaults
prefix
to/usr/local
, you could possibly use/var/local
. But I don't believe anybody does that in practice. For one, note that/var/local
is probably empty on your system. For two, note that as soon as you or anybody running./configure
changesprefix
to/usr
, you can't use/var/local
, and the only remaining option is/var/lib
.