[nsd-users] patch for nsd using hardcoded name "nsd"

Greg A. Woods woods at planix.ca
Thu Jul 16 18:40:56 UTC 2009

At Thu, 16 Jul 2009 13:01:24 -0400 (EDT), Paul Wouters <paul at xelerance.com> wrote:
Subject: Re: [nsd-users] patch for nsd using hardcoded name "nsd"
> Mostly, the problem is with stale pid files, and the use of "pidof" to
> determine if a certain instance is still running. Having different
> names makes them fully independant of each other.

Indeed PID files are another issue that must be dealt with when running
multiple instances of a daemon on the same host (especially without
chroot or equivalent).

It would be nice if the daemon automatically chose unique identifiers
for each instance, and if argv[0], or especially the final pathname
component of argv[0], is usually made to be unique for purposes of
starting each instance then this value would be a good default choice
for the unique identifier, at least for some sites.

However I remember now that in the production environments I've designed
in the past the ideal mechanism to run multiple instances of a daemon is
a simple wrapper script (eg. copies of the BSD /etc/rc.d script) that
invoke each instance with a unique set of command-line parameters
(eg. separate config files, etc. -- whatever else is necessary).  Thus
argv[0] will be identical for both instances and so it falls back to
having the unique identifier optionally be specified as a configuration
item (command-line parameter or config file entry, etc.).

As a only barely related side note in relation to newsyslog I will also
mention the multiple PID file issue for daemons where each instance
writes to the same log file.  In the ToDo notes for the version of
newsyslog I maintain I've made the following comments and questions:

- what happens, or should happen, if/when there are multiple PIDs in a

- consider supporting the specification of multiple pidfiles for a given
  log for the case where multiple long-running daemons write to the same
  logfile, eg. as:


  Or teach people to either use a proper syslog daemon instead of
  allowing/configuring their daemons to write directly to any log files,
  or else teach them to always use separate log files for each instance!

						Greg A. Woods
						Planix, Inc.

<woods at planix.com>       +1 416 218-0099        http://www.planix.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
URL: <http://lists.nlnetlabs.nl/pipermail/nsd-users/attachments/20090716/0b768947/attachment.bin>

More information about the nsd-users mailing list