Bugzilla – Bug 84
Bind8 stats are not working when running nsd as unprivileged user
Last modified: 2004-07-28 15:40:27 CEST
I run nsd as the user bind and it runs fine but when I try to make it log bind8
stats by sending it SIGILL it just logs the following message:
[root@ ]# kill -SIGILL `cat /var/run/nsd.pid` && tail -1 /var/log/messages
Jul 21 01:09:00 nsd: problems killing 66219: Operation not permitted
66215 is the primary process and 66219 is the secondary.
When I send SIGILL to the secondary process as root it works fine but sending
the SIGILL to the primary process (as -s 60 seems to do) just logs the
Thus, periodical bind8 stats logging is not working for me.
This is reproducable on FreeBSD 5.2-CURRENT and MacOS X 10.3.4. But the "Operation not permitted"
error only occurs with SIGILL, not SIGTERM or SIGHUP. Which is strange because the kill(2) manual page
does not mention anything special about permissions and SIGILL.
SIGILL works fine on Linux and FreeBSD 4.10-STABLE, so this seems to be an operating system error.
Actually its not an error in the OS.
FreeBSD considers changing the owner of a process to be "tainting" and only
allows certain signals to be sent to such "tainted" processes.
In a recent (5.*) /usr/src/sys/kern/kern_prot.c you can see the list of
SIGILL is not in that list and is therefor not permitted without privilege.
I suggest finding another signal for this.
Then it is a bug in the documentation. Is there any place where this "tainting" is documented?
Anyway, we are planning to change the signal used to SIGUSR1.
It is documented to some extent in issetugid(2) and P_SUGID is defined
#define P_SUGID 0x00100 /* Had set id privileges since last exec. */
and in cr_cansignal (/usr/src/sys/kern/kern_prot.c) there is a small comment:
* UNIX signal semantics depend on the status of the P_SUGID
* bit on the target process. If the bit is set, then additional
* restrictions are placed on the set of available signals.
Other than that I haven't seen it...and to be honest I had to dig around to
Created attachment 18 [details]
Patch to change SIGILL to SIGUSR1
The patch is against NSD 2.1.1 and should apply cleanly.
Great, this fixes things for me and I'll change the FreeBSD port to include