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>
This commit is contained in:
Robin H. Johnson
2011-01-05 22:03:43 -08:00
parent 6df531d33d
commit 09f990a7c8
13 changed files with 119 additions and 9 deletions

View File

@ -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