diff options
Diffstat (limited to 'init')
-rw-r--r-- | init/Config.in | 1 | ||||
-rw-r--r-- | init/init.c | 18 |
2 files changed, 10 insertions, 9 deletions
diff --git a/init/Config.in b/init/Config.in index 6b5799f..395c9e2 100644 --- a/init/Config.in +++ b/init/Config.in @@ -32,6 +32,7 @@ config FEATURE_KILL_DELAY int "How long to wait between TERM and KILL (0 - send TERM only)" if FEATURE_KILL_REMOVED range 0 1024 default 0 + depends on FEATURE_KILL_REMOVED help With nonzero setting, init sends TERM, forks, child waits N seconds, sends KILL and exits. Setting it too high is unwise diff --git a/init/init.c b/init/init.c index 59d0709..ed01e71 100644 --- a/init/init.c +++ b/init/init.c @@ -780,16 +780,16 @@ static void reload_inittab(void) for (a = init_action_list; a; a = a->next) if (a->pid != 0) kill(a->pid, SIGTERM); -#if CONFIG_FEATURE_KILL_DELAY - /* NB: parent will wait in NOMMU case */ - if ((BB_MMU ? fork() : vfork()) == 0) { /* child */ - sleep(CONFIG_FEATURE_KILL_DELAY); - for (a = init_action_list; a; a = a->next) - if (a->pid != 0) - kill(a->pid, SIGKILL); - _exit(EXIT_SUCCESS); + if (CONFIG_FEATURE_KILL_DELAY) { + /* NB: parent will wait in NOMMU case */ + if ((BB_MMU ? fork() : vfork()) == 0) { /* child */ + sleep(CONFIG_FEATURE_KILL_DELAY); + for (a = init_action_list; a; a = a->next) + if (a->pid != 0) + kill(a->pid, SIGKILL); + _exit(EXIT_SUCCESS); + } } -#endif } /* Remove old and unused entries */ |