From 70afaa16f56c98926ef04871becdd6ea951601cd Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Wed, 11 Oct 2017 22:04:53 +0200 Subject: [PATCH] sm_step(): Log pending stopped svc if we exit state machine Signed-off-by: Joachim Nilsson --- src/sm.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/sm.c b/src/sm.c index f2983a69..8083efe1 100644 --- a/src/sm.c +++ b/src/sm.c @@ -89,6 +89,7 @@ int sm_is_in_teardown(sm_t *sm) void sm_step(sm_t *sm) { + svc_t *svc; sm_state_t old_state; restart: @@ -155,8 +156,11 @@ restart: * Need to wait for any services to stop? If so, exit early * and perform second stage from service_monitor later. */ - if (!svc_stop_completed()) + svc = svc_stop_completed(); + if (svc) { + _e("Waiting to collect %s(%d) ...", svc->cmd, svc->pid); break; + } /* Prev runlevel services stopped, call hooks before starting new runlevel ... */ _d("All services have been stoppped, calling runlevel change hooks ..."); @@ -208,8 +212,11 @@ restart: * Need to wait for any services to stop? If so, exit early * and perform second stage from service_monitor later. */ - if (!svc_stop_completed()) + svc = svc_stop_completed(); + if (svc) { + _e("Waiting to collect %s(%d) ...", svc->cmd, svc->pid); break; + } sm->in_teardown = 0; /* Cleanup stale services */