Refactor, use new iwatch module for inotify of Finit *.conf files

- Use iwatch, modeled after pidfile plugin
- Use one .conf watcher for all *.conf paths/files
- Use full path of conf file for changes, from realpath().
  This fixes a long-standing limitation on unique filenames
  for services, that absolutely nobody knew about

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2021-02-25 14:28:03 +01:00
parent ea278a6370
commit 7ef25abecf
3 changed files with 65 additions and 106 deletions
+4 -4
View File
@@ -449,7 +449,7 @@ int main(int argc, char *argv[])
/*
* Initialize .conf system and load static /etc/finit.conf.
*/
conf_init();
conf_init(&loop);
/* Base FS up, enable standard SysV init signals */
sig_setup(&loop);
@@ -458,10 +458,10 @@ int main(int argc, char *argv[])
plugin_run_hooks(HOOK_BASEFS_UP);
/*
* Set up inotify watcher for /etc/finit.d and read all .conf
* files to figure out how to bootstrap the system.
* Set up inotify watcher for /etc/finit.conf, /etc/finit.d, and
* their deps, to figure out how to bootstrap the system.
*/
conf_monitor(&loop);
conf_monitor();
_d("Starting initctl API responder ...");
api_init(&loop);