NetBSD-Bugs archive

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

Re: bin/41302: cron dies at startup

The following reply was made to PR bin/41302; it has been noted by GNATS.

From: Martin Husemann <>
Subject: Re: bin/41302: cron dies at startup
Date: Sun, 3 May 2009 11:04:27 +0200

 This is a funny one:
 init (pid 1) runs /bin/sh (pid 2) to execute /etc/rc. Now in my startup, cron
 is the last daemon to start. While cron is doing the daemonize() dance,
 sh is done and exits, via exit1(), which contains this code:
     352                         if (tp->t_session == sp) {
     353                                 /* we can't guarantee the revoke will 
do this */
     354                                 pgrp = tp->t_pgrp;
     355                                 tp->t_pgrp = NULL;
     356                                 tp->t_session = NULL;
     357                                 mutex_spin_exit(&tty_lock);
     358                                 if (pgrp != NULL) {
     359                                         pgsignal(pgrp, SIGHUP, 1);
     360                                 }
 pgrp is 2, and the cron parent process is still in this group.
 I wonder if deamonize() should sigignore SIGHUP (and undo that in the child)?

Home | Main Index | Thread Index | Old Index