mirror of
https://github.com/troglobit/finit.git
synced 2026-11-10 16:31:21 +00:00
Wait for all services to complete before changing runlevel
We allow all run/task/services to complete before changing runlevel. This means stepping them all while we wait for their completion, since services may depend on each other. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
231b887b2a
commit
060de93b5b
2 files changed
+6
No files matched your search
@@ -481,6 +481,9 @@ int main(int argc, char* argv[])
|
|||||||
api_init(&loop);
|
api_init(&loop);
|
||||||
umask(022);
|
umask(022);
|
||||||
|
|
||||||
|
/* Finalize bootstrap, allow service/run/tasks to complete */
|
||||||
|
service_step_all(SVC_TYPE_ANY);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Wait for all SVC_TYPE_RUNTASK to have completed their work in
|
* Wait for all SVC_TYPE_RUNTASK to have completed their work in
|
||||||
* [S], or timeout, before calling finalize()
|
* [S], or timeout, before calling finalize()
|
||||||
|
|||||||
@@ -1267,6 +1267,9 @@ void service_bootstrap_cb(uev_t *w, void *arg, int events)
|
|||||||
static int cnt = 120;
|
static int cnt = 120;
|
||||||
void (*finalize)(void) = arg;
|
void (*finalize)(void) = arg;
|
||||||
|
|
||||||
|
_d("Step all services ...");
|
||||||
|
service_step_all(SVC_TYPE_ANY);
|
||||||
|
|
||||||
_d("Checking completion of all run/task ... %d", cnt);
|
_d("Checking completion of all run/task ... %d", cnt);
|
||||||
if (cnt-- > 0 && !service_runtask_completed(!runlevel))
|
if (cnt-- > 0 && !service_runtask_completed(!runlevel))
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in new issue
Block a user