Anand Buddhdev wrote:
On 17/06/2013 18:00, Robert Edmonds wrote:
side note: PID files *must* be placed in
/var/run, not /var/lib, on
systems that comply with the filesystem hierarchy standard. some
non-FHS systems (e.g., freebsd) do not even have /var/lib.
in general i would recommend using /var/run/${DAEMON}/${DAEMON}.pid for
pidfiles, creating /var/run/${DAEMON}/ if necessary, owned by the
daemon's uid/gid. then you can use the same directory for lock files,
control sockets, etc.
I agree with Robert here. It would be useful if knot's configure script
provided two options such as "--with-dbdir=" and "--with-piddir=" so
that when compiling for Linux systems, I can do:
./configure --with-dbdir=/var/lib/knot --with-piddir=/var/run/knot
Knot could then use $piddir as the default base directory for creating
its PID file in, whereas the zones and journals would go into $dbdir. Of
course, a user can override any of these settings in knot.conf, but the
defaults would be sane, and compliant with FHS.
a slightly different way to do this would be what unbound does, which is
to have separate configure settings for the "run-dir" (e.g.,
/var/run/unbound) and files that default to being placed within the
"run-dir" like the pidfile.
An RPM or DEB package maintainer could then have the
package create
/var/lib/knot and /var/run/knot with the correct ownership and
permissions. At least, that's what I do with my BIND and NSD packages.
directories under /var/run should be created in the daemon's init
script, not in the package. on many systems /var/run is a tmpfs.
--
Robert Edmonds
edmonds(a)debian.org