diff -Naur ppp-2.4.5/pppd/main.c ppp-2.4.5-magellan/pppd/main.c --- ppp-2.4.5/pppd/main.c 2009-11-16 23:26:07.000000000 +0100 +++ ppp-2.4.5-magellan/pppd/main.c 2010-08-20 12:36:00.000000000 +0200 @@ -144,7 +144,7 @@ int hungup; /* terminal has been hung up */ int privileged; /* we're running as real uid root */ int need_holdoff; /* need holdoff period before restarting */ -int detached; /* have detached from terminal */ +int detached = 0; /* have detached from terminal */ volatile int status; /* exit status for pppd */ int unsuccess; /* # unsuccessful connection attempts */ int do_callback; /* != 0 if we should do callback next */ @@ -1402,7 +1402,14 @@ sigemptyset(&act.sa_mask); /* unnecessary in fact */ act.sa_handler = SIG_IGN; act.sa_flags = 0; - kill(0, sig); + if (detached) + kill(0, sig); + else { + struct subprocess *chp; + /* process group wasn't created (yet), kill all children instead */ + for (chp = children; chp != NULL; chp = chp->next) + kill(chp->pid, sig); + } /* * The kill() above made the signal pending for us, as well as * the rest of our process group, but we don't want it delivered