On 18 June 2013 04:05, Robert Edmonds <edmonds@debian.org> wrote:
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.

That we already do as Anand described. The 'storage' config option is a default for where the things like file locks, PID files and slave zones go. The 'pidfile' can override that and also zones
can override their file location. I believe the point was to be able to run without creating a 
PID file (although it brings several limitations to how a control tool could be used).
But I guess it's probably more correct to have pidfile/socks in one directory and data storage in a separate one.

Many thanks.

Marek
 

> 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@debian.org
_______________________________________________
knot-dns-users mailing list
knot-dns-users@lists.nic.cz
https://lists.nic.cz/cgi-bin/mailman/listinfo/knot-dns-users