aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-08-17 11:31:36 +0000
committerRoy Marples <roy@marples.name>2007-08-17 11:31:36 +0000
commitadbe0393851b13ecb8f979cd5b8b53c92be761b0 (patch)
treeb2e5f04c5487278b4102ce32ee4e74233137816b
parentbc90e41b76b3cfd44da55e4f4da8bbe9d82f5969 (diff)
When shutting down, stop the service even if dependants failed.
-rw-r--r--src/runscript.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/runscript.c b/src/runscript.c
index 20e7561d..1bab5690 100644
--- a/src/runscript.c
+++ b/src/runscript.c
@@ -879,8 +879,17 @@ static void svc_stop (bool deps)
/* We used to loop 3 times here - maybe re-do this if needed */
rc_wait_service (svc);
if (! rc_service_state (svc, rc_service_stopped)) {
- if (rc_runlevel_stopping ())
+
+ if (rc_runlevel_stopping ()) {
+ /* If shutting down, we should stop even if a dependant failed */
+ if (softlevel &&
+ (strcmp (softlevel, RC_LEVEL_SHUTDOWN) == 0 ||
+ strcmp (softlevel, RC_LEVEL_REBOOT) == 0 ||
+ strcmp (softlevel, RC_LEVEL_SINGLE) == 0))
+ continue;
rc_mark_service (svc, rc_service_failed);
+ }
+
eerrorx ("ERROR: cannot stop %s as %s is still up",
applet, svc);
}