aboutsummaryrefslogtreecommitdiff
path: root/src/rc
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2011-01-05 22:03:43 -0800
committerRobin H. Johnson <robbat2@gentoo.org>2011-01-05 22:09:34 -0800
commit09f990a7c835d75f67cfe696a35e8c46e67c612f (patch)
treeda69536cd225bad4028b01e88a0629bdca472dc1 /src/rc
parent6df531d33d0f3c3cad8edcafdcd62525ca30fc1f (diff)
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 <robbat2@gentoo.org>
Diffstat (limited to 'src/rc')
-rw-r--r--src/rc/rc.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/rc/rc.c b/src/rc/rc.c
index ccafbe38..b062349a 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