sm

sysmgr implemented in C
git clone git://git.ckyln.com/sm
Log | Files | Refs | README | LICENSE

commit 5c997dc11316c52b86bab86b854b5c39baa2ac22
parent c200f8ea876d2e515fe78ff6d780e771069b0ac3
Author: Cem Keylan <cem@ckyln.com>
Date:   Sat, 10 Oct 2020 14:12:16 +0300

svctl: fix return statuses.

Diffstat:
Msvctl.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/svctl.c b/svctl.c @@ -45,11 +45,13 @@ int handle_service(char *operation, char *name) return 0; return rm_rf(sv.svrundir); } else if (strcmp(operation, "stop") == 0 || strcmp(operation, "down") == 0) { + if(sv_check(&sv, 1) != 0) + return 0; pid = getsyspid(&sv); switch (pid) { case -1: perror(NULL); - return 1; + return -1; default: sv_writelock(sv.lockfile, SIGTERM); kill(pid, SIGTERM);