aboutsummaryrefslogtreecommitdiff
path: root/src/rc
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-01-13 11:02:00 +0000
committerRoy Marples <roy@marples.name>2009-01-13 11:02:00 +0000
commitabcc4c5c72147a16b8710392112e4a07c3ed4b55 (patch)
treea51853543ec80a94727a2535b95f0fb013003e09 /src/rc
parentfcf1cce549542bc6948c8b808becbd5933f15bf4 (diff)
Don't allow SYSVINIT parameters through anymore.
RC_REBOOT is now yes when rebooting. Document the special reboot runlevel.
Diffstat (limited to 'src/rc')
-rw-r--r--src/rc/rc-misc.c3
-rw-r--r--src/rc/rc.c8
2 files changed, 7 insertions, 4 deletions
diff --git a/src/rc/rc-misc.c b/src/rc/rc-misc.c
index 58af1418..0d9511f3 100644
--- a/src/rc/rc-misc.c
+++ b/src/rc/rc-misc.c
@@ -112,11 +112,10 @@ rc_conf_yesno(const char *setting)
}
static const char *const env_whitelist[] = {
- "PATH", "SHELL", "USER", "HOME", "TERM",
+ "CONSOLE", "PATH", "SHELL", "USER", "HOME", "TERM",
"LANG", "LC_CTYPE", "LC_NUMERIC", "LC_TIME", "LC_COLLATE",
"LC_MONETARY", "LC_MESSAGES", "LC_PAPER", "LC_NAME", "LC_ADDRESS",
"LC_TELEPHONE", "LC_MEASUREMENT", "LC_IDENTIFICATION", "LC_ALL",
- "INIT_HALT", "INIT_VERSION", "RUNLEVEL", "PREVLEVEL", "CONSOLE",
"IN_HOTPLUG", "IN_BACKGROUND", "RC_INTERFACE_KEEP_CONFIG",
NULL
};
diff --git a/src/rc/rc.c b/src/rc/rc.c
index b5459601..a7a7b8d8 100644
--- a/src/rc/rc.c
+++ b/src/rc/rc.c
@@ -842,10 +842,14 @@ main(int argc, char **argv)
}
newlevel = argv[optind++];
- /* For compat with old system */
+ /* To make life easier, we only have the shutdown runlevel as
+ * nothing really needs to know that we're rebooting.
+ * But for those that do, you can test against RC_REBOOT. */
if (newlevel) {
- if (strcmp(newlevel, "reboot") == 0)
+ if (strcmp(newlevel, "reboot") == 0) {
newlevel = UNCONST(RC_LEVEL_SHUTDOWN);
+ setenv("RC_REBOOT", "yes", 1);
+ }
}
/* Enable logging */