diff options
Diffstat (limited to 'init')
| -rw-r--r-- | init/init.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/init/init.c b/init/init.c index 1f0bd4aec..657bad6cd 100644 --- a/init/init.c +++ b/init/init.c | |||
| @@ -847,7 +847,14 @@ static void new_init_action(int action, char *command, const char *cons) | |||
| 847 | } | 847 | } |
| 848 | 848 | ||
| 849 | /* Append to the end of the list */ | 849 | /* Append to the end of the list */ |
| 850 | for (a = init_action_list; a && a->next; a = a->next); | 850 | for (a = init_action_list; a && a->next; a = a->next) { |
| 851 | /* don't enter action if it's already in the list */ | ||
| 852 | if ((strcmp(a->command, command) == 0) && | ||
| 853 | (strcmp(a->terminal, cons) ==0)) { | ||
| 854 | free(new_action); | ||
| 855 | return; | ||
| 856 | } | ||
| 857 | } | ||
| 851 | if (a) { | 858 | if (a) { |
| 852 | a->next = new_action; | 859 | a->next = new_action; |
| 853 | } else { | 860 | } else { |
| @@ -1022,7 +1029,14 @@ static void parse_inittab(void) | |||
| 1022 | #endif /* CONFIG_FEATURE_USE_INITTAB */ | 1029 | #endif /* CONFIG_FEATURE_USE_INITTAB */ |
| 1023 | } | 1030 | } |
| 1024 | 1031 | ||
| 1025 | 1032 | static void reload_signal(int sig) | |
| 1033 | { | ||
| 1034 | message(LOG, "Reloading /etc/inittab"); | ||
| 1035 | parse_inittab(); | ||
| 1036 | run_actions(RESPAWN); | ||
| 1037 | return; | ||
| 1038 | } | ||
| 1039 | |||
| 1026 | extern int init_main(int argc, char **argv) | 1040 | extern int init_main(int argc, char **argv) |
| 1027 | { | 1041 | { |
| 1028 | struct init_action *a; | 1042 | struct init_action *a; |
| @@ -1120,6 +1134,9 @@ extern int init_main(int argc, char **argv) | |||
| 1120 | loop_forever(); | 1134 | loop_forever(); |
| 1121 | } | 1135 | } |
| 1122 | 1136 | ||
| 1137 | /* Redefine SIGHUP to reread /etc/inittab */ | ||
| 1138 | signal(SIGHUP, reload_signal); | ||
| 1139 | |||
| 1123 | /* Now run the looping stuff for the rest of forever */ | 1140 | /* Now run the looping stuff for the rest of forever */ |
| 1124 | while (1) { | 1141 | while (1) { |
| 1125 | /* run the respawn stuff */ | 1142 | /* run the respawn stuff */ |
