mirror of
https://github.com/troglobit/finit.git
synced 2026-10-17 10:49:34 +00:00
Add 'notify:pid' style readiness notifaction and 'readiness none'
This change expands the readiness notification system in Finit with the
native 'pid' style, which will remain the default readiness in Finit 4.x
For systems that want to transition to Finit 5.x early, a global option
to set 'readiness none' in /etc/finit.conf, has been added. This change
the service default notification mode to 'notify:none', which can also
be set by Finit 4.x ('readiness pid') for select services.
Fixes #386.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
6443995fc9
commit
0b5c555c7f
10 files changed
+88
-50
No files matched your search
+2
-2
@@ -150,11 +150,11 @@ static void setup(void *arg)
|
||||
* Note: dbus drops privs after starting up.
|
||||
*/
|
||||
if (pidfn) {
|
||||
snprintf(line, sizeof(line), "[S123456789] cgroup.system name:dbus pid:!%s %s %s -- %s",
|
||||
snprintf(line, sizeof(line), "[S123456789] cgroup.system notify:none name:dbus pid:!%s %s %s -- %s",
|
||||
pidfn, cmd, DBUS_ARGS, DBUS_DESC);
|
||||
free(pidfn);
|
||||
} else
|
||||
snprintf(line, sizeof(line), "[S123456789] cgroup.system name:dbus %s %s -- %s",
|
||||
snprintf(line, sizeof(line), "[S123456789] cgroup.system notify:none name:dbus %s %s -- %s",
|
||||
cmd, DBUS_ARGS, DBUS_DESC);
|
||||
|
||||
conf_save_service(SVC_TYPE_SERVICE, line, "dbus.conf");
|
||||
|
||||
+4
-4
@@ -88,7 +88,7 @@ static void pidfile_update_conds(char *dir, char *name, uint32_t mask)
|
||||
* systemd style services rely on their respective
|
||||
* readiness notification. Issue #343
|
||||
*/
|
||||
if (!svc->notify)
|
||||
if (svc->notify == SVC_NOTIFY_PID)
|
||||
svc_started(svc);
|
||||
|
||||
if (!svc_has_pidfile(svc)) {
|
||||
@@ -121,11 +121,11 @@ static void pidfile_update_conds(char *dir, char *name, uint32_t mask)
|
||||
}
|
||||
|
||||
cond_set(cond);
|
||||
if (!svc->notify)
|
||||
if (svc->notify == SVC_NOTIFY_PID)
|
||||
service_ready(svc);
|
||||
} else if (mask & IN_DELETE) {
|
||||
cond_clear(cond);
|
||||
if (!svc->notify)
|
||||
if (svc->notify == SVC_NOTIFY_PID)
|
||||
service_ready(svc);
|
||||
}
|
||||
}
|
||||
@@ -240,7 +240,7 @@ static void pidfile_reconf(void *arg)
|
||||
if (svc_is_changed(svc) || svc_is_starting(svc))
|
||||
continue;
|
||||
|
||||
if (!svc->notify)
|
||||
if (svc->notify == SVC_NOTIFY_PID)
|
||||
service_ready(svc);
|
||||
|
||||
mkcond(svc, cond, sizeof(cond));
|
||||
|
||||
Reference in new issue
Block a user