Support delayed load of services from plugins and bundled services

This adds a new function conf_save_service() replacing service_register() for
plugins and bundled services like watchdogd, keventd, runparts, etc.

The benefits to this change are several:

 - Plugin/Bundled services no longer risk starting before udev or other
   critical services/task have started
 - Definitions can be overridden by an administrator (see docs)
 - Increases visibility (user: where are all these services coming from?)
   Previously the origin (file the service was loaded from) was NULL.
 - Adds another level of extensibility to Finit

The most notable change is that dbus is no longer started before udevd.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2023-10-04 18:37:43 +02:00
parent eaaf8d862e
commit 5d703fd39e
6 changed files with 61 additions and 14 deletions
+1 -3
View File
@@ -157,9 +157,7 @@ static void setup(void *arg)
snprintf(line, sizeof(line), "[S123456789] cgroup.system name:dbus %s %s -- %s",
cmd, DBUS_ARGS, DBUS_DESC);
if (service_register(SVC_TYPE_SERVICE, line, global_rlimit, NULL))
err(1, "Failed registering %s", DBUS_DAEMON);
conf_save_service(SVC_TYPE_SERVICE, line, "dbus.conf");
free(cmd);
}