Skip to content

Commit

Permalink
initctl: slight improvement to status output for sysv services
Browse files Browse the repository at this point in the history
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
  • Loading branch information
troglobit committed Apr 25, 2022
1 parent 09f46f6 commit 30fb978
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/initctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,13 @@ static char *svc_command(svc_t *svc, char *buf, size_t len)
strlcat(buf, svc->args[i], len);
}

if (svc_is_sysv(svc)) {
char *cmd = svc->state == SVC_HALTED_STATE ? "stop" : "start";

strlcat(buf, " ", len);
strlcat(buf, cmd, len);
}

strlcat(buf, bold ? "\e[0m" : "", len);

return buf;
Expand Down

0 comments on commit 30fb978

Please sign in to comment.