From 09f990a7c835d75f67cfe696a35e8c46e67c612f Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Wed, 5 Jan 2011 22:03:43 -0800 Subject: Implement explicit selection of subsystem types. - Fixes bugs #347583, #349389, both of which were triggered by cgroups being detected as the LXC subsystem type. - Makes it much easier to select "prefix" type. - "rc -S" will now print a warning if you have not configured rc_sys in /etc/rc.conf - All other semantics of rc_sys are unchanged in this patch. Signed-off-by: Robin H. Johnson --- src/rc/rc.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/rc/rc.c') diff --git a/src/rc/rc.c b/src/rc/rc.c index ccafbe3..b062349 100644 --- a/src/rc/rc.c +++ b/src/rc/rc.c @@ -878,9 +878,16 @@ main(int argc, char **argv) eerrorx("%s: %s", applet, strerror(errno)); /* NOTREACHED */ case 'S': - bootlevel = rc_sys(); - if (bootlevel) - printf("%s\n", bootlevel); + if (rc_conf_value("rc_sys")) { + bootlevel = rc_sys_v2(); + if(bootlevel) + printf("%s\n", bootlevel); + } else { + ewarn("WARNING: rc_sys not defined in rc.conf. Falling back to automatic detection"); + bootlevel = rc_sys_v1(); + if(bootlevel) + printf("%s\n", bootlevel); + } exit(EXIT_SUCCESS); /* NOTREACHED */ case_RC_COMMON_GETOPT -- cgit v1.2.3