aboutsummaryrefslogtreecommitdiff
path: root/src/rc.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-11-23 12:04:11 +0000
committerRoy Marples <roy@marples.name>2007-11-23 12:04:11 +0000
commitd81def80b00a3dbcb4f8980f4503c4d659b48a2a (patch)
tree64a5df4281620cacbc1f03838d42e88167886fc9 /src/rc.c
parentf077f179edaeb746b267421baa29ec751c38b713 (diff)
Move /etc/conf.d/rc to /etc/rc.conf.
Lowercase all configurable variables, non configurations remain uppercase. Replace rc_env_bool with rc_yesno. Split localmount info procfs (Linux) and dumpon, savecore (BSD)
Diffstat (limited to 'src/rc.c')
-rw-r--r--src/rc.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/rc.c b/src/rc.c
index 33f6ef37..1bd8e2c3 100644
--- a/src/rc.c
+++ b/src/rc.c
@@ -492,6 +492,8 @@ static char read_key (bool block)
static bool want_interactive (void)
{
char c;
+ static bool gotinteractive;
+ static bool interactive;
if (PREVLEVEL &&
strcmp (PREVLEVEL, "N") != 0 &&
@@ -499,7 +501,11 @@ static bool want_interactive (void)
strcmp (PREVLEVEL, "1") != 0)
return (false);
- if (! rc_env_bool ("RC_INTERACTIVE"))
+ if (! gotinteractive) {
+ gotinteractive = true;
+ interactive = rc_conf_yesno ("rc_interactive");
+ }
+ if (! interactive)
return (false);
c = read_key (false);
@@ -793,6 +799,7 @@ int main (int argc, char **argv)
int opt;
DIR *dp;
struct dirent *d;
+ bool parallel;
atexit (cleanup);
if (argv[0])
@@ -982,7 +989,7 @@ int main (int argc, char **argv)
ecolor (ECOLOR_GOOD), ecolor (ECOLOR_BRACKET),
ecolor (ECOLOR_NORMAL));
- if (rc_env_bool ("RC_INTERACTIVE"))
+ if (rc_conf_yesno ("rc_interactive"))
printf ("Press %sI%s to enter interactive boot mode\n\n",
ecolor (ECOLOR_GOOD), ecolor (ECOLOR_NORMAL));
@@ -1156,7 +1163,7 @@ int main (int argc, char **argv)
if (newlevel && strcmp (newlevel, bootlevel) == 0 &&
(strcmp (runlevel, RC_LEVEL_SINGLE) == 0 ||
strcmp (runlevel, RC_LEVEL_SYSINIT) == 0) &&
- rc_env_bool ("RC_COLDPLUG"))
+ rc_conf_yesno ("rc_coldplug"))
{
#if defined(__DragonFly__) || defined(__FreeBSD__)
/* The net interfaces are easy - they're all in net /dev/net :) */
@@ -1263,6 +1270,8 @@ int main (int argc, char **argv)
if (going_down)
rc_runlevel_set (newlevel);
+ parallel = rc_conf_yesno ("rc_parallel");
+
/* Now stop the services that shouldn't be running */
STRLIST_FOREACH (stop_services, service, i) {
bool found = false;
@@ -1278,7 +1287,7 @@ int main (int argc, char **argv)
/* We always stop the service when in these runlevels */
if (going_down) {
pid_t pid = rc_service_stop (service);
- if (pid > 0 && ! rc_env_bool ("RC_PARALLEL"))
+ if (pid > 0 && ! parallel)
rc_waitpid (pid);
continue;
}
@@ -1348,7 +1357,7 @@ int main (int argc, char **argv)
if ((pid = rc_service_stop (service)) > 0) {
add_pid (pid);
- if (! rc_env_bool ("RC_PARALLEL")) {
+ if (! parallel) {
rc_waitpid (pid);
remove_pid (pid);
}
@@ -1448,7 +1457,7 @@ interactive_option:
if ((pid = rc_service_start (service)) > 0) {
add_pid (pid);
- if (! rc_env_bool ("RC_PARALLEL")) {
+ if (! parallel) {
rc_waitpid (pid);
remove_pid (pid);
}