aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-07-11 14:28:54 +0000
committerRoy Marples <roy@marples.name>2007-07-11 14:28:54 +0000
commite778dcbfb0ef9cb8101ac7e51c88c322f7ccbd22 (patch)
tree3183217d113f3062a77077a285817320e0193644 /src
parent74d52e749d08d4666b3a08d80ad3a08956ba0c6d (diff)
Fix restarting services with plugins
Diffstat (limited to 'src')
-rw-r--r--src/runscript.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/runscript.c b/src/runscript.c
index c67e3e3e..e817d0c8 100644
--- a/src/runscript.c
+++ b/src/runscript.c
@@ -234,18 +234,16 @@ static void start_services (char **list) {
static void cleanup (void)
{
- if (! rc_in_plugin && prefix_locked)
- unlink (PREFIX_LOCK);
-
- if (hook_out)
- rc_plugin_run (hook_out, applet);
- rc_plugin_unload ();
-
- if (restart_services ) {
- start_services (restart_services);
- rc_strlist_free (restart_services);
+ if (! rc_in_plugin) {
+ if (prefix_locked)
+ unlink (PREFIX_LOCK);
+ if (hook_out)
+ rc_plugin_run (hook_out, applet);
+ if (restart_services)
+ start_services (restart_services);
}
+ rc_plugin_unload ();
rc_free_deptree (deptree);
rc_strlist_free (services);
rc_strlist_free (types);
@@ -253,6 +251,7 @@ static void cleanup (void)
rc_strlist_free (providelist);
rc_strlist_free (need_services);
rc_strlist_free (use_services);
+ rc_strlist_free (restart_services);
rc_strlist_free (tmplist);
free (ibsave);
@@ -716,7 +715,7 @@ static void svc_start (bool deps)
p = tmp;
STRLIST_FOREACH (tmplist, svc, i) {
if (i > 1) {
- if (i == n - 1)
+ if (i == n)
p += snprintf (p, len, " or ");
else
p += snprintf (p, len, ", ");
@@ -1049,14 +1048,10 @@ int main (int argc, char **argv)
STRLIST_FOREACH (env, p, i)
putenv (p);
-
/* We don't free our list as that would be null in environ */
}
softlevel = rc_get_runlevel ();
-
- /* If not called from RC or another service then don't be parallel */
- unsetenv ("RC_PARALLEL");
}
setenv ("RC_ELOG", service, 1);