aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-04-27 12:04:33 +0000
committerRoy Marples <roy@marples.name>2009-04-27 12:04:33 +0000
commit94b3057571eed817e8aa0dd1b016ec7988328132 (patch)
tree2773a18f49f4ce68f7dd08403fd5d74509ee7f14 /src
parent338c93733d238f78cbad4b9d96f8592edf86af13 (diff)
Add the noshutdown keyword to special case the shutdown.
Diffstat (limited to 'src')
-rw-r--r--src/rc/rc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rc/rc.c b/src/rc/rc.c
index 0be79011..9b4a7e5c 100644
--- a/src/rc/rc.c
+++ b/src/rc/rc.c
@@ -573,7 +573,7 @@ runlevel_config(const char *service, const char *level)
}
static void
-do_stop_services(const char *newlevel, bool parallel)
+do_stop_services(const char *newlevel, bool parallel, bool going_down)
{
pid_t pid;
RC_STRING *service, *svc1, *svc2;
@@ -602,7 +602,8 @@ do_stop_services(const char *newlevel, bool parallel)
continue;
}
kwords = rc_deptree_depend(deptree, service->value, "keyword");
- if (rc_stringlist_find(kwords, "nostop"))
+ if (rc_stringlist_find(kwords, "nostop") ||
+ (going_down && rc_stringlist_find(kwords, "noshutdown")))
nstop = true;
else
nstop = false;
@@ -1063,7 +1064,7 @@ main(int argc, char **argv)
/* Now stop the services that shouldn't be running */
if (stop_services)
- do_stop_services(newlevel, parallel);
+ do_stop_services(newlevel, parallel, going_down);
/* Wait for our services to finish */
wait_for_services();