16

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.

4
  • On a related note, see this Fedora wiki item about converting /var/tmp and /var/run to tmpfs. Apr 21, 2011 at 3:53
  • I think this is in reply to my question about backups for /var and not this current question. (Phil Hollenback's reply)
    – fthinker
    Apr 21, 2011 at 4:27
  • I was just pointing out there's a lot of confusion about what goes in /var and how it's supposed to work. Apr 21, 2011 at 4:52
  • Ah, I'm sorry. But yes, the whole construction of /var is a bit bewildering.
    – fthinker
    Apr 21, 2011 at 17:47

2 Answers 2

15

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

2
  • 2
    Don't forget that there is a /var/local directory for storing what would be in /var/opt. So imo this question still remains open unless the answer is that it is just a matter of opinion :)
    – fthinker
    Apr 21, 2011 at 4:24
  • 4
    Well, the FHS is a standard created mostly for use by distributions. As a user you are free to put your data wherever you want. IMO it is mostly a matter of opinion. Personally I've never put data anywhere other than /var/lib for the reasons I've stated above. Unless you're planning to distribute software you expect to be installed on FHS systems, I think it's mostly a non-issue and more of a matter of site policy than anything else. Apr 21, 2011 at 4:56
2

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 in opt 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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .