I can't decipher the deciding factor on where to place "variable program data" for an /opt installed package. On one hand the FHS says to place all variable data that dictates a program's state into /var/lib and that this data should stick around after a reboot. It also says this data is host specific. Now the FHS also says that the /var/opt directory should house opt "variable data". So.. lets just say I have installed a package and I have the option of setting its "working directory (this is how the package names this path)". Where should I put it?
For reference See:
http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLIBVARIABLESTATEINFORMATION http://www.pathname.com/fhs/pub/fhs-2.3.html#VAROPTVARIABLEDATAFOROPT
Note that this question naturally extends to /usr/local variable data as well.
If you want to strictly follow the FHS, then
/var/opt/<appname>
for the data of apps installed in/opt
is the right place to go. Stuff installed in/usr/local
typically just used/var/lib/<appname>
.Of course, in practice I think there is little difference unless you have some overlap between your opt/local apps and the ones that come packaged with your distro. I tend to just put everything in to
/var/lib
since that's the first place myself or anyone would look. Most people are not familiar with or not expecting to find things in/var/opt
The difference between
/var/opt
and/var/lib
(or similarly between/opt
and/lib
) is usually whether any particular package comes from the standard OS repository or manually downloaded and installed/compiled by the administrator. Again usually what ends up inopt
folders is purchased non-free programs and 3rd party software not installed by the OS package manager. Those programs and software usually have their own way of self-management, e.g. satisfying library dependencies, un-installation, etc.