diff options
-rw-r--r-- | init/init.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/init/init.c b/init/init.c index 05ed4f7a7..edb5be696 100644 --- a/init/init.c +++ b/init/init.c | |||
@@ -638,7 +638,7 @@ static void new_init_action(uint8_t action_type, const char *command, const char | |||
638 | a->action_type = action_type; | 638 | a->action_type = action_type; |
639 | strcpy(a->command, command); | 639 | strcpy(a->command, command); |
640 | safe_strncpy(a->terminal, cons, sizeof(a->terminal)); | 640 | safe_strncpy(a->terminal, cons, sizeof(a->terminal)); |
641 | dbg_message(L_LOG | L_CONSOLE, "command='%s' action=%d tty='%s'\n", | 641 | dbg_message(L_LOG | L_CONSOLE, "command='%s' action=%x tty='%s'\n", |
642 | a->command, a->action_type, a->terminal); | 642 | a->command, a->action_type, a->terminal); |
643 | } | 643 | } |
644 | 644 | ||
@@ -934,10 +934,17 @@ static void reload_inittab(void) | |||
934 | 934 | ||
935 | /* Remove stale entries and SYSINIT entries. | 935 | /* Remove stale entries and SYSINIT entries. |
936 | * We never rerun SYSINIT entries anyway, | 936 | * We never rerun SYSINIT entries anyway, |
937 | * removing them too saves a few bytes */ | 937 | * removing them too saves a few bytes |
938 | */ | ||
938 | nextp = &init_action_list; | 939 | nextp = &init_action_list; |
939 | while ((a = *nextp) != NULL) { | 940 | while ((a = *nextp) != NULL) { |
940 | if ((a->action_type & ~SYSINIT) == 0) { | 941 | /* |
942 | * Why pid == 0 check? | ||
943 | * Process can be removed from inittab and added *later*. | ||
944 | * If we delete its entry but process still runs, | ||
945 | * duplicate is spawned when the entry is re-added. | ||
946 | */ | ||
947 | if ((a->action_type & ~SYSINIT) == 0 && a->pid == 0) { | ||
941 | *nextp = a->next; | 948 | *nextp = a->next; |
942 | free(a); | 949 | free(a); |
943 | } else { | 950 | } else { |