mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
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:
+2
-4
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user