Unified shutdown and init to use 3 second wait between SIGTERM and
SIGKILL. Defined this value in init.h (WAIT_BETWEEN_SIGNALS) for easy modification. Updated documentation to address Debian bug #375274.
This commit is contained in:
@@ -133,7 +133,7 @@ int wrote_wtmp_reboot = 1; /* Set when we wrote the reboot record */
|
||||
int wrote_utmp_reboot = 1; /* Set when we wrote the reboot record */
|
||||
int wrote_wtmp_rlevel = 1; /* Set when we wrote the runlevel record */
|
||||
int wrote_utmp_rlevel = 1; /* Set when we wrote the runlevel record */
|
||||
int sltime = 5; /* Sleep time between TERM and KILL */
|
||||
int sltime = WAIT_BETWEEN_SIGNALS; /* Sleep time between TERM and KILL */
|
||||
char *argv0; /* First arguments; show up in ps listing */
|
||||
int maxproclen; /* Maximal length of argv[0] with \0 */
|
||||
struct utmp utproto; /* Only used for sizeof(utproto.ut_id) */
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#define INITPID 1 /* pid of first process */
|
||||
#define PIPE_FD 10 /* Fileno of initfifo. */
|
||||
#define STATE_PIPE 11 /* used to pass state through exec */
|
||||
#define WAIT_BETWEEN_SIGNALS 3 /* default time to wait between TERM and KILL */
|
||||
|
||||
/* Failsafe configuration */
|
||||
#define MAXSPAWN 10 /* Max times respawned in.. */
|
||||
|
||||
@@ -348,7 +348,7 @@ void fastdown()
|
||||
/* Kill all processes. */
|
||||
fprintf(stderr, "shutdown: sending all processes the TERM signal...\r\n");
|
||||
kill(-1, SIGTERM);
|
||||
sleep(sltime ? atoi(sltime) : 3);
|
||||
sleep(sltime ? atoi(sltime) : WAIT_BETWEEN_SIGNALS);
|
||||
fprintf(stderr, "shutdown: sending all processes the KILL signal.\r\n");
|
||||
(void) kill(-1, SIGKILL);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user