dbus: signalling a stopped service is an error

Manager1.Signal silently skipped stopped services, so the same
command gave different exit codes depending on transport: the legacy
INIT_CMD_SIGNAL path fails when the service is not running.  Mirror
the legacy behavior.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2026-08-16 22:03:37 +02:00
parent b53c7e6879
commit 2af83ea632
+2 -4
View File
@@ -488,11 +488,9 @@ static int signal_one(svc_t *svc, void *udata)
{
int signo = *(int *)udata;
/* Silently skip stopped services -- a multi-match ident
* (e.g. "sshd:*") should not fail the whole call just because
* one of the matches happens to be in a halted state. */
/* Signalling a stopped service is an error, like the legacy API */
if (!svc_is_running(svc))
return 0;
return 1;
return !!kill(svc->pid, signo);
}