From 278994781b395f49810e95695df31d2a6c323721 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sun, 16 Oct 2022 23:52:32 +0200 Subject: [PATCH] Follow-up to c9f1bff, only allow daemons to reach 'READY' state By definition, the readiness notification is reserved for daemons. May possibly be extended also to sysv services later. If you arrive hare with that request, please file an issue with the project. Signed-off-by: Joachim Wiberg --- src/service.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/service.c b/src/service.c index ccb0e494..a3adb680 100644 --- a/src/service.c +++ b/src/service.c @@ -2038,11 +2038,14 @@ void service_forked(svc_t *svc) svc_set_state(svc, SVC_RUNNING_STATE); } -/* Set service/foo/ready condition and call optional ready:script */ +/* Set service/foo/ready condition for services and call optional ready:script */ void service_ready(svc_t *svc) { char buf[MAX_COND_LEN]; + if (!svc_is_daemon(svc)) + return; + snprintf(buf, sizeof(buf), "service/%s/ready", svc_ident(svc, NULL, 0)); cond_set(buf);