NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/50125: Incorrect PID in /var/run/

>Number:         50125
>Category:       bin
>Synopsis:       Incorrect PID in /var/run/
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 05 07:55:00 +0000 2015
>Originator:     Jarle Greipsland
>Release:        NetBSD 7.99.18
System: NetBSD 7.99.18 NetBSD 7.99.18 (SINGSAKER) #0: Thu Jun 4 14:37:01 CEST 2015 i386
Architecture: i386
Machine: i386
The PID recorded in /var/run/ when mountd is started is not the
correct one.  A bug seems to have been introduced (-r1.126) when the

      if (debug == 0) {
              daemon(0, 0);
              (void)signal(SIGINT, SIG_IGN);
              (void)signal(SIGQUIT, SIG_IGN);

statements were moved further down in the main() function, so as to appear
_after_ the call to the pidfile() function.  Since the daemon() function uses
fork() in order to detach itself from its parent, the PID recorded in
/var/run/ will be that of the mountd program prior to the fork.
And not the PID that the mountd program will use during normal operations.

Start mountd.  Try to do 'kill -HUP `cat /var/run/`'.

Move the call to pidfile() to someplace after the daemon() call.



Home | Main Index | Thread Index | Old Index