Fix #300: add ready:script for services, called when daemon is ready

In Finit a daemon can signal its readiness by creating/touching its PID
file.  An ancient UNIX concept -- a daemon creates its PID file when it
has set up signal handlers and is ready to receive IPC (signals), right
before entering its while(1) loop.

Finit took the concept a bit further, adding readiness signalling also
to daemon's by touching their PID file after having processed a SIGHUP.

For both these conditions Finit now supports a ready:script, called when
readiness is detected.  In later commits support for s6 and systemd
style readiness notification will be added that will hook the mechanism
implemented in this commit as well.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2022-08-23 09:37:18 +02:00
1 parent 0ae5071f94
commit abcb3ceb67
4 files changed
+55 -1

No files matched your search

+2
View File
@@ -35,6 +35,8 @@ void service_runtask_clean (void);
void service_reload_dynamic (void);
void service_update_rdeps (void);
void service_ready_script (svc_t *svc); /* XXX: only for pidfile plugin before notify framework */
int service_timeout_after (svc_t *svc, int timeout, void (*cb)(svc_t *svc));
int service_timeout_cancel (svc_t *svc);