mirror of
https://github.com/troglobit/finit.git
synced 2026-10-02 22:13:01 +07:00
Refactor, enter main event loop earlier
This delays the start of the .conf monitor and service initialization slightly to allow the event loop to run earlier to process any events from the initial setup. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
+11
-11
@@ -580,6 +580,17 @@ static void bootstrap_worker(void *work)
|
||||
static int cnt = 120 * 10; /* We run with 100ms period */
|
||||
int level = cfglevel;
|
||||
|
||||
/*
|
||||
* Set up inotify watcher for /etc/finit.conf, /etc/finit.d, and
|
||||
* their deps, to figure out how to bootstrap the system.
|
||||
*/
|
||||
conf_monitor();
|
||||
|
||||
/*
|
||||
* Background service tasks
|
||||
*/
|
||||
service_init();
|
||||
|
||||
_d("Step all services ...");
|
||||
service_step_all(SVC_TYPE_ANY);
|
||||
|
||||
@@ -821,12 +832,6 @@ int main(int argc, char *argv[])
|
||||
_d("Base FS up, calling hooks ...");
|
||||
plugin_run_hooks(HOOK_BASEFS_UP);
|
||||
|
||||
/*
|
||||
* Set up inotify watcher for /etc/finit.conf, /etc/finit.d, and
|
||||
* their deps, to figure out how to bootstrap the system.
|
||||
*/
|
||||
conf_monitor();
|
||||
|
||||
_d("Starting initctl API responder ...");
|
||||
api_init(&loop);
|
||||
|
||||
@@ -836,11 +841,6 @@ int main(int argc, char *argv[])
|
||||
_d("Starting bootstrap finalize timer ...");
|
||||
schedule_work(&bootstrap_work);
|
||||
|
||||
/*
|
||||
* Background service tasks
|
||||
*/
|
||||
service_init();
|
||||
|
||||
/*
|
||||
* Enter main loop to monitor /dev/initctl and services
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user