aboutsummaryrefslogtreecommitdiff
path: root/src/rc
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-04-24 11:49:55 +0000
committerRoy Marples <roy@marples.name>2009-04-24 11:49:55 +0000
commitc07b384d82f78959adc96fbbbef72cae5bf3c272 (patch)
tree0c65dad5b01384e118d4b09e4b435a68c4f865af /src/rc
parentbd211d534bb654bdef9b8c072be0c0d4f24fbf7c (diff)
Don't drop to sulogin by default, but make this configurable.
Diffstat (limited to 'src/rc')
-rw-r--r--src/rc/rc.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/rc/rc.c b/src/rc/rc.c
index 83a3701b..56d6d580 100644
--- a/src/rc/rc.c
+++ b/src/rc/rc.c
@@ -299,7 +299,7 @@ run_program(const char *prog)
if (termios_orig)
tcsetattr(STDIN_FILENO, TCSANOW, termios_orig);
- execl(prog, prog, (char *) NULL);
+ execl(prog, prog, (char *)NULL);
eerror("%s: unable to exec `%s': %s", applet, prog,
strerror(errno));
_exit(EXIT_FAILURE);
@@ -312,12 +312,14 @@ run_program(const char *prog)
}
static void
-sulogin(bool cont)
+open_shell(void)
{
+ const char *shell;
+
#ifdef __linux__
const char *sys = rc_sys();
- /* VSERVER and OPENVZ systems cannot do a sulogin */
+ /* VSERVER and OPENVZ systems cannot really drop to shells */
if (sys &&
(strcmp(sys, "VSERVER") == 0 || strcmp(sys, "OPENVZ") == 0))
{
@@ -326,15 +328,11 @@ sulogin(bool cont)
applet, strerror(errno));
}
#endif
- if (!cont) {
- rc_logger_close();
- exit(EXIT_SUCCESS);
- }
-#ifdef __linux__
- run_program(SULOGIN);
-#else
- run_program("/bin/sh");
-#endif
+
+ shell = rc_conf_value("rc_shell");
+ if (shell == NULL)
+ shell = "/bin/sh";
+ run_program(shell);
}
_dead static void
@@ -695,7 +693,7 @@ do_start_services(bool parallel)
case '1': break;
case '2': continue;
case '3': interactive = false; break;
- case '4': sulogin(true); goto interactive_retry;
+ case '4': open_shell(); goto interactive_retry;
default: goto interactive_option;
}
}