From adbe0393851b13ecb8f979cd5b8b53c92be761b0 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Fri, 17 Aug 2007 11:31:36 +0000 Subject: [PATCH] When shutting down, stop the service even if dependants failed. --- src/runscript.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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); }