aboutsummaryrefslogtreecommitdiff
path: root/src/runscript.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/runscript.c')
-rw-r--r--src/runscript.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/runscript.c b/src/runscript.c
index ad8a251c..0b440e29 100644
--- a/src/runscript.c
+++ b/src/runscript.c
@@ -234,14 +234,7 @@ static void cleanup (void)
if (in_control ())
{
- if (rc_service_state (applet, rc_service_starting))
- {
- if (rc_service_state (applet, rc_service_wasinactive))
- rc_mark_service (applet, rc_service_inactive);
- else
- rc_mark_service (applet, rc_service_stopped);
- }
- else if (rc_service_state (applet, rc_service_stopping))
+ if (rc_service_state (applet, rc_service_stopping))
{
/* If the we're shutting down, do it cleanly */
if ((softlevel &&
@@ -254,6 +247,13 @@ static void cleanup (void)
else
rc_mark_service (applet, rc_service_started);
}
+ else if (rc_service_state (applet, rc_service_starting))
+ {
+ if (rc_service_state (applet, rc_service_wasinactive))
+ rc_mark_service (applet, rc_service_inactive);
+ else
+ rc_mark_service (applet, rc_service_stopped);
+ }
if (exclusive && rc_exists (exclusive))
unlink (exclusive);
}
@@ -778,7 +778,7 @@ static void svc_stop (const char *service, bool deps)
if (rc_service_state (service, rc_service_wasinactive))
rc_mark_service (service, rc_service_inactive);
else
- rc_mark_service (service, rc_service_stopped);
+ rc_mark_service (service, rc_service_started);
eerrorx ("ERROR: %s failed to stop", applet);
}