From 2f3ffd053f9a8f2cce20aceae70e27b2df142c74 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Sat, 1 Mar 2008 10:38:47 +0000 Subject: [PATCH] We should use shutdown to goto single user mode. --- src/rc/rc.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/rc/rc.c b/src/rc/rc.c index d35af51d..102461d5 100644 --- a/src/rc/rc.c +++ b/src/rc/rc.c @@ -355,16 +355,9 @@ static void single_user (void) { rc_logger_close (); -#ifdef __linux__ - execl ("/sbin/telinit", "/sbin/telinit", "S", (char *) NULL); - eerrorx ("%s: unable to exec `/sbin/telinit': %s", + execl (SHUTDOWN, SHUTDOWN, "now", (char *) NULL); + eerrorx ("%s: unable to exec `" SHUTDOWN "': %s", applet, strerror (errno)); -#else - if (kill (1, SIGTERM) != 0) - eerrorx ("%s: unable to send SIGTERM to init (pid 1): %s", - applet, strerror (errno)); - exit (EXIT_SUCCESS); -#endif } static bool set_ksoftlevel (const char *level)