Preferred directory for server data (/var/db/pkgname?)

Christian Schwarz me at cschwarz.com
Thu Jan 12 12:12:38 UTC 2017


What is the correct directory for storing the state of a server application?

That might be

 - the data directory of a database server
   (MySQL uses /var/db/mysql
    Postgres uses /var/db/postgres)
 - Configuration managed by the application, not the admin
   (Quassel uses /var/db/quasselcore)
 - net-im/prosody curiously uses /usr/local/var/lib/prosody
   to store application-managed state data [1]

I am writing this because I stumbled over the net-im/prosody path,
which I think is not intuitive given the behavior of other ports.

But before I submit my patch for this, I would like to know if there is an
actual policy in place.

Taking a look at hier(7):

>/var/          multi-purpose log, temporary, transient, and spool files
>
>				[...]
>
>                db/            miscellaneous automatically generated
>                               system-specific database files

Doesn't seem like the above cases match this description.

Interestingly, the Arch Linux hier(7) has an entry for this kind of data:

> /var/lib/<package>
>        State data for packages and subsystems (optional).

What do you think?

--
Christian Schwarz


More information about the freebsd-ports mailing list