summaryrefslogtreecommitdiff
path: root/src/rc/rc.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-10-10 09:08:59 +0000
committerRoy Marples <roy@marples.name>2008-10-10 09:08:59 +0000
commit50b8aba8d9cd5042f395ed7478400742dd3457f5 (patch)
tree6fb482ad331c504ace5ee64de92a828085a9358b /src/rc/rc.c
parent72dcac8c55e9994c48739f908d49889d880d8468 (diff)
downloadopenrc-50b8aba8d9cd5042f395ed7478400742dd3457f5.tar.gz
openrc-50b8aba8d9cd5042f395ed7478400742dd3457f5.tar.bz2
openrc-50b8aba8d9cd5042f395ed7478400742dd3457f5.tar.xz
Remove coldplug and just have hotplug which is a list of allowed/disallowed services. Makes things much easier.
Diffstat (limited to 'src/rc/rc.c')
-rw-r--r--src/rc/rc.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/src/rc/rc.c b/src/rc/rc.c
index cb4045f..4b76a6d 100644
--- a/src/rc/rc.c
+++ b/src/rc/rc.c
@@ -87,7 +87,7 @@ static char *PREVLEVEL = NULL;
const char *applet = NULL;
static char *runlevel = NULL;
-static RC_STRINGLIST *coldplugged_services = NULL;
+static RC_STRINGLIST *hotplugged_services = NULL;
static RC_STRINGLIST *stop_services = NULL;
static RC_STRINGLIST *start_services = NULL;
static RC_STRINGLIST *types_n = NULL;
@@ -162,7 +162,7 @@ static void cleanup(void)
p1 = p2;
}
- rc_stringlist_free(coldplugged_services);
+ rc_stringlist_free(hotplugged_services);
rc_stringlist_free(stop_services);
rc_stringlist_free(start_services);
rc_stringlist_free(types_n);
@@ -738,20 +738,13 @@ interactive_option:
}
pid = service_start(service->value);
-
/* Remember the pid if we're running in parallel */
if (pid > 0) {
add_pid(pid);
-
if (! parallel) {
rc_waitpid(pid);
remove_pid(pid);
- /* Attempt to open the logger as a service may
- * mount the needed /dev/pts for this to work */
- if (rc_logger_tty == -1)
- rc_logger_open(runlevel);
}
-
}
}
@@ -1024,8 +1017,8 @@ int main(int argc, char **argv)
stop_services = tmplist;
}
- /* Load our list of coldplugged services */
- coldplugged_services = rc_services_in_state(RC_SERVICE_COLDPLUGGED);
+ /* Load our list of hotplugged services */
+ hotplugged_services = rc_services_in_state(RC_SERVICE_HOTPLUGGED);
if (strcmp(newlevel ? newlevel : runlevel, RC_LEVEL_SINGLE) != 0 &&
strcmp(newlevel ? newlevel : runlevel, RC_LEVEL_SHUTDOWN) != 0 &&
strcmp(newlevel ? newlevel : runlevel, RC_LEVEL_REBOOT) != 0)
@@ -1048,10 +1041,10 @@ int main(int argc, char **argv)
free(tmplist);
}
- if (coldplugged_services) {
+ if (hotplugged_services) {
if (!start_services)
start_services = rc_stringlist_new();
- TAILQ_FOREACH(service, coldplugged_services, entries)
+ TAILQ_FOREACH(service, hotplugged_services, entries)
rc_stringlist_addu(start_services, service->value);
}
}
@@ -1102,10 +1095,10 @@ int main(int argc, char **argv)
rc_plugin_run(RC_HOOK_RUNLEVEL_START_IN, runlevel);
hook_out = RC_HOOK_RUNLEVEL_START_OUT;
- /* Re-add our coldplugged services if they stopped */
- if (coldplugged_services)
- TAILQ_FOREACH(service, coldplugged_services, entries)
- rc_service_mark(service->value, RC_SERVICE_COLDPLUGGED);
+ /* Re-add our hotplugged services if they stopped */
+ if (hotplugged_services)
+ TAILQ_FOREACH(service, hotplugged_services, entries)
+ rc_service_mark(service->value, RC_SERVICE_HOTPLUGGED);
/* Order the services to start */
if (start_services) {
@@ -1132,7 +1125,7 @@ int main(int argc, char **argv)
do_start_services(parallel);
/* FIXME: If we skip the boot runlevel and go straight
* to default from sysinit, we should now re-evaluate our
- * start services + coldplugged services and call
+ * start services + hotplugged services and call
* do_start_services a second time. */
/* Wait for our services to finish */