From dcdfdb442f436cd1f1bdfdc46622f5d6f48f8061 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Sun, 6 Apr 2008 20:06:07 +0000 Subject: Some systems are only detectable after /proc is mounted, so re-test if unknown. --- src/rc/rc.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/rc/rc.c') diff --git a/src/rc/rc.c b/src/rc/rc.c index b305b2d..5ae7e1f 100644 --- a/src/rc/rc.c +++ b/src/rc/rc.c @@ -935,11 +935,13 @@ static void handle_bad_signal(int sig) static const struct option longopts[] = { { "override", 1, NULL, 'o' }, { "service", 1, NULL, 's' }, + { "sys", 0, NULL, 'S' }, longopts_COMMON }; static const char * const longopts_help[] = { "override the next runlevel to change into\nwhen leaving single user or boot runlevels", "runs the service specified with the rest\nof the arguments", + "output the RC system type, if any", longopts_help_COMMON }; #include "_usage.c" @@ -1028,6 +1030,12 @@ int main(int argc, char **argv) execv(*argv, argv); eerrorx("%s: %s", applet, strerror(errno)); /* NOTREACHED */ + case 'S': + bootlevel = rc_sys(); + if (bootlevel) + printf("%s\n", bootlevel); + exit(EXIT_SUCCESS); + /* NOTREACHED */ case_RC_COMMON_GETOPT } } -- cgit v1.2.3