On reload/restart we must wait for services to stop first

This patch adds support for declaring *why* a service is being stopped
or reloaded.  This is later used when all stopped services have been
collected by the `service_monitor()` to issue start or postponed SIGHUP.

As an added benefit we can now also see why a service is not running.
If it has been paused by a user, halted when moving to another runlevel,
waiting for a condition (event), or similar.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2015-11-22 10:11:27 +01:00
1 parent b1d57d6828
commit 924bf041bc
9 files changed
+92 -36

No files matched your search

+1 -2
View File
@@ -220,12 +220,11 @@ void event_dispatch(char *msg)
service_restart(svc);
} else { /* change == -1 */
if (svc->pid && !event_service_cond(svc->events))
service_stop(svc);
service_stop(svc, SVC_CONDHALT_STATE);
}
}
}
/**
* Local Variables:
* version-control: t