Track run/tasks, should run at least once per declared runlevel

This patch adds a 'once' counter to the svc_t for run/task jobs.  This
counter is incremented when Finit calls service_start() and is reset on
runlevel changes.

Also, at the end of a runlevel each run/task have their state reset to
SVC_HALTED_STATE so they can be launched again for the new runlevel, if
so declared.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2017-12-13 17:58:48 +01:00
1 parent 5117b723c2
commit 3c015f384d
4 files changed
+31 -2

No files matched your search

+3
View File
@@ -145,6 +145,9 @@ restart:
if (runlevel != 0 && runlevel != 6)
conf_reload_dynamic();
/* Reset once flag of runtasks */
service_runtask_clean();
_d("Stopping services services not allowed in new runlevel ...");
sm->in_teardown = 1;
service_step_all(SVC_TYPE_ANY);