]> git.ipfire.org Git - thirdparty/systemd.git/commit
systemctl: is-*: return correct code when no unit is found
authorMike Yuan <me@yhndnzj.com>
Sat, 10 Dec 2022 12:55:42 +0000 (20:55 +0800)
committerMike Yuan <me@yhndnzj.com>
Tue, 13 Dec 2022 17:43:25 +0000 (01:43 +0800)
commit43e48a47383e05914b4a96c31d356ea8aa9f98f5
tree237f97cffa63b656a87895d55e2267ce0e496a39
parent09e917ea4dd6f00aa3cb225072f6991a637227e1
systemctl: is-*: return correct code when no unit is found

According to systemctl(1), we should use LSB return code 4
(EXIT_PROGRAM_OR_SERVICES_STATUS_UNKNOWN) when the state
is "no such unit" for is-{active,failed,enabled} verbs.

Fixes #25680
src/systemctl/systemctl-is-active.c
src/systemctl/systemctl-is-enabled.c
src/systemctl/systemctl-sysv-compat.c
src/systemctl/systemctl-sysv-compat.h