Codebase list sysvinit / 1b659c8
Applied patch from Daniel Povey which should allow killall5/pidof to avoid locking up if it encounters stopped or zombie processes due to broken NFS mount points. This should allow Debian bug #719273 to be closed. Jesse Smith 5 years ago
4 changed file(s) with 29 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
1616 flag may not properly shut down network interfaces if the interface
1717 does not have an IP address.
1818 Addresses Debian bug #361935.
19 * Applied patch from Daniel Povey which should allow killall5/pidof to
20 avoid locking up if it encounters stopped or zombie processes
21 due to broken NFS mount points.
22 This should allow Debian bug #719273 to be closed.
1923
2024
2125 sysvinit (2.91) world; urgency=low
152152 .PP
153153 When \fBinit\fP is requested to change the runlevel, it sends the
154154 warning signal \s-1\fBSIGTERM\fP\s0 to all processes that are undefined
155 in the new runlevel. It then waits 5 seconds before forcibly
155 in the new runlevel. It then waits 3 seconds before forcibly
156156 terminating these processes via the \s-1\fBSIGKILL\fP\s0 signal.
157157 Note that \fBinit\fP assumes that all these processes (and their
158158 descendants) remain in the same process group which \fBinit\fP
177177 tell \fBinit\fP to switch to single user mode.
178178 .IP "\fBU\fP or \fBu\fP"
179179 tell \fBinit\fP to re-execute itself (preserving the state). No re-examining of
180 \fB/etc/inittab\fP file happens. Run level should be one of
180 \fB/etc/inittab\fP file happens. Runlevel should be one of
181181 \fBSs0123456\fP
182182 otherwise request would be silently ignored.
183183 .PP
22232223
22242224 /*
22252225 * We shouldn't be here, something failed.
2226 * Bitch, close the state pipe, unblock signals and return.
2226 * Close the state pipe, unblock signals and return.
22272227 */
22282228 init_freeenv(env);
22292229 close(fd);
483483 unsigned long startcode, endcode;
484484 int pid, f;
485485 ssize_t len;
486 char process_status[11];
486487
487488 /* Open the /proc directory. */
488489 if (chdir("/proc") == -1) {
566567
567568 /* Get session, startcode, endcode. */
568569 startcode = endcode = 0;
570 /*
569571 if (sscanf(q, "%*c %*d %*d %d %*d %*d %*u %*u "
570572 "%*u %*u %*u %*u %*u %*d %*d "
571573 "%*d %*d %*d %*d %*u %*u %*d "
572574 "%*u %lu %lu",
573575 &p->sid, &startcode, &endcode) != 3) {
576 */
577 if (sscanf(q, "%10s %*d %*d %d %*d %*d %*u %*u "
578 "%*u %*u %*u %*u %*u %*d %*d "
579 "%*d %*d %*d %*d %*u %*u %*d "
580 "%*u %lu %lu",
581 process_status,
582 &p->sid, &startcode, &endcode) != 4) {
583
574584 p->sid = 0;
575585 nsyslog(LOG_ERR, "can't read sid from %s\n",
576586 path);
585595 if (startcode == 0 && endcode == 0)
586596 p->kernel = 1;
587597 fclose(fp);
598 if ( (strchr(process_status, 'D') != NULL) ||
599 (strchr(process_status, 'Z') != NULL) ){
600 /* Ignore zombie processes or processes in
601 disk sleep, as attempts
602 to access the stats of these will
603 sometimes fail. */
604 if (p->argv0) free(p->argv0);
605 if (p->argv1) free(p->argv1);
606 if (p->statname) free(p->statname);
607 free(p);
608 continue;
609 }
588610 } else {
589611 /* Process disappeared.. */
590612 if (p->argv0) free(p->argv0);