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 6b5799fe3..395c9e2f3 100644 --- a/init/Config.in +++ b/init/Config.in | |||
@@ -32,6 +32,7 @@ config FEATURE_KILL_DELAY | |||
32 | int "How long to wait between TERM and KILL (0 - send TERM only)" if FEATURE_KILL_REMOVED | 32 | int "How long to wait between TERM and KILL (0 - send TERM only)" if FEATURE_KILL_REMOVED |
33 | range 0 1024 | 33 | range 0 1024 |
34 | default 0 | 34 | default 0 |
35 | depends on FEATURE_KILL_REMOVED | ||
35 | help | 36 | help |
36 | With nonzero setting, init sends TERM, forks, child waits N | 37 | With nonzero setting, init sends TERM, forks, child waits N |
37 | seconds, sends KILL and exits. Setting it too high is unwise | 38 | seconds, sends KILL and exits. Setting it too high is unwise |
diff --git a/init/init.c b/init/init.c index 59d070950..ed01e71c0 100644 --- a/init/init.c +++ b/init/init.c | |||
@@ -780,16 +780,16 @@ static void reload_inittab(void) | |||
780 | for (a = init_action_list; a; a = a->next) | 780 | for (a = init_action_list; a; a = a->next) |
781 | if (a->pid != 0) | 781 | if (a->pid != 0) |
782 | kill(a->pid, SIGTERM); | 782 | kill(a->pid, SIGTERM); |
783 | #if CONFIG_FEATURE_KILL_DELAY | 783 | if (CONFIG_FEATURE_KILL_DELAY) { |
784 | /* NB: parent will wait in NOMMU case */ | 784 | /* NB: parent will wait in NOMMU case */ |
785 | if ((BB_MMU ? fork() : vfork()) == 0) { /* child */ | 785 | if ((BB_MMU ? fork() : vfork()) == 0) { /* child */ |
786 | sleep(CONFIG_FEATURE_KILL_DELAY); | 786 | sleep(CONFIG_FEATURE_KILL_DELAY); |
787 | for (a = init_action_list; a; a = a->next) | 787 | for (a = init_action_list; a; a = a->next) |
788 | if (a->pid != 0) | 788 | if (a->pid != 0) |
789 | kill(a->pid, SIGKILL); | 789 | kill(a->pid, SIGKILL); |
790 | _exit(EXIT_SUCCESS); | 790 | _exit(EXIT_SUCCESS); |
791 | } | ||
791 | } | 792 | } |
792 | #endif | ||
793 | } | 793 | } |
794 | 794 | ||
795 | /* Remove old and unused entries */ | 795 | /* Remove old and unused entries */ |