diff options
| author | kraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-06-12 20:55:02 +0000 |
|---|---|---|
| committer | kraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-06-12 20:55:02 +0000 |
| commit | 3deb340e775c969acceb5542074554013d07a44e (patch) | |
| tree | f699f05e05eb7424bee359eb7f8a2975b04f329e /init | |
| parent | 272fd187394ada246db05d4505257dd342948331 (diff) | |
| download | busybox-w32-3deb340e775c969acceb5542074554013d07a44e.tar.gz busybox-w32-3deb340e775c969acceb5542074554013d07a44e.tar.bz2 busybox-w32-3deb340e775c969acceb5542074554013d07a44e.zip | |
Only use a login shell when it will run on a console.
git-svn-id: svn://busybox.net/trunk/busybox@2815 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'init')
| -rw-r--r-- | init/init.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/init/init.c b/init/init.c index 6369ef959..e057caa7e 100644 --- a/init/init.c +++ b/init/init.c | |||
| @@ -124,7 +124,8 @@ static const int RB_AUTOBOOT = 0x01234567; | |||
| 124 | #define VT_LOG "/dev/tty5" /* Virtual console */ | 124 | #define VT_LOG "/dev/tty5" /* Virtual console */ |
| 125 | #define SERIAL_CON0 "/dev/ttyS0" /* Primary serial console */ | 125 | #define SERIAL_CON0 "/dev/ttyS0" /* Primary serial console */ |
| 126 | #define SERIAL_CON1 "/dev/ttyS1" /* Serial console */ | 126 | #define SERIAL_CON1 "/dev/ttyS1" /* Serial console */ |
| 127 | #define SHELL "-/bin/sh" /* Default shell */ | 127 | #define SHELL "/bin/sh" /* Default shell */ |
| 128 | #define LOGIN_SHELL "-" SHELL /* Default login shell */ | ||
| 128 | #define INITTAB "/etc/inittab" /* inittab file location */ | 129 | #define INITTAB "/etc/inittab" /* inittab file location */ |
| 129 | #ifndef INIT_SCRIPT | 130 | #ifndef INIT_SCRIPT |
| 130 | #define INIT_SCRIPT "/etc/init.d/rcS" /* Default sysinit script. */ | 131 | #define INIT_SCRIPT "/etc/init.d/rcS" /* Default sysinit script. */ |
| @@ -435,7 +436,7 @@ static pid_t run(char *command, char *terminal, int get_enter) | |||
| 435 | termType, | 436 | termType, |
| 436 | "HOME=/", | 437 | "HOME=/", |
| 437 | "PATH=/usr/bin:/bin:/usr/sbin:/sbin", | 438 | "PATH=/usr/bin:/bin:/usr/sbin:/sbin", |
| 438 | "SHELL=/bin/sh", | 439 | "SHELL=" SHELL, |
| 439 | "USER=root", | 440 | "USER=root", |
| 440 | NULL | 441 | NULL |
| 441 | }; | 442 | }; |
| @@ -782,16 +783,16 @@ static void parse_inittab(void) | |||
| 782 | /* Umount all filesystems on halt/reboot */ | 783 | /* Umount all filesystems on halt/reboot */ |
| 783 | new_initAction(SHUTDOWN, "/bin/umount -a -r", console); | 784 | new_initAction(SHUTDOWN, "/bin/umount -a -r", console); |
| 784 | /* Askfirst shell on tty1 */ | 785 | /* Askfirst shell on tty1 */ |
| 785 | new_initAction(ASKFIRST, SHELL, console); | 786 | new_initAction(ASKFIRST, LOGIN_SHELL, console); |
| 786 | /* Askfirst shell on tty2 */ | 787 | /* Askfirst shell on tty2 */ |
| 787 | if (secondConsole != NULL) | 788 | if (secondConsole != NULL) |
| 788 | new_initAction(ASKFIRST, SHELL, secondConsole); | 789 | new_initAction(ASKFIRST, LOGIN_SHELL, secondConsole); |
| 789 | /* Askfirst shell on tty3 */ | 790 | /* Askfirst shell on tty3 */ |
| 790 | if (thirdConsole != NULL) | 791 | if (thirdConsole != NULL) |
| 791 | new_initAction(ASKFIRST, SHELL, thirdConsole); | 792 | new_initAction(ASKFIRST, LOGIN_SHELL, thirdConsole); |
| 792 | /* Askfirst shell on tty4 */ | 793 | /* Askfirst shell on tty4 */ |
| 793 | if (fourthConsole != NULL) | 794 | if (fourthConsole != NULL) |
| 794 | new_initAction(ASKFIRST, SHELL, fourthConsole); | 795 | new_initAction(ASKFIRST, LOGIN_SHELL, fourthConsole); |
| 795 | /* sysinit */ | 796 | /* sysinit */ |
| 796 | new_initAction(SYSINIT, INIT_SCRIPT, console); | 797 | new_initAction(SYSINIT, INIT_SCRIPT, console); |
| 797 | 798 | ||
| @@ -944,13 +945,13 @@ extern int init_main(int argc, char **argv) | |||
| 944 | !strcmp(argv[1], "-s") || !strcmp(argv[1], "1"))) { | 945 | !strcmp(argv[1], "-s") || !strcmp(argv[1], "1"))) { |
| 945 | /* Ask first then start a shell on tty2-4 */ | 946 | /* Ask first then start a shell on tty2-4 */ |
| 946 | if (secondConsole != NULL) | 947 | if (secondConsole != NULL) |
| 947 | new_initAction(ASKFIRST, SHELL, secondConsole); | 948 | new_initAction(ASKFIRST, LOGIN_SHELL, secondConsole); |
| 948 | if (thirdConsole != NULL) | 949 | if (thirdConsole != NULL) |
| 949 | new_initAction(ASKFIRST, SHELL, thirdConsole); | 950 | new_initAction(ASKFIRST, LOGIN_SHELL, thirdConsole); |
| 950 | if (fourthConsole != NULL) | 951 | if (fourthConsole != NULL) |
| 951 | new_initAction(ASKFIRST, SHELL, fourthConsole); | 952 | new_initAction(ASKFIRST, LOGIN_SHELL, fourthConsole); |
| 952 | /* Start a shell on tty1 */ | 953 | /* Start a shell on tty1 */ |
| 953 | new_initAction(RESPAWN, SHELL, console); | 954 | new_initAction(RESPAWN, LOGIN_SHELL, console); |
| 954 | } else { | 955 | } else { |
| 955 | /* Not in single user mode -- see what inittab says */ | 956 | /* Not in single user mode -- see what inittab says */ |
| 956 | 957 | ||
