mirror of
https://github.com/troglobit/finit.git
synced 2026-10-21 11:29:42 +00:00
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:
1 parent
0ae5071f94
commit
abcb3ceb67
4 files changed
+55
-1
No files matched your search
@@ -297,10 +297,17 @@ int cond_set_noupdate(const char *name)
|
||||
|
||||
void cond_set(const char *name)
|
||||
{
|
||||
svc_t *svc;
|
||||
|
||||
_d("%s", name);
|
||||
if (cond_set_noupdate(name))
|
||||
return;
|
||||
|
||||
/* XXX: refactor when new notify framework is in place */
|
||||
svc = svc_find_by_cond(name);
|
||||
if (svc && svc_has_ready(svc))
|
||||
service_ready_script(svc);
|
||||
|
||||
cond_update(name);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user