chiark / gitweb /
systemctl: add is-failed
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Thu, 27 Dec 2012 16:39:48 +0000 (17:39 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 3 Jan 2013 23:33:25 +0000 (00:33 +0100)
commit1a0fce458d3b45624c5817006735d59a5689ef83
treeaf19cc44d5034336094be2bfa5e807a2e725fbc0
parentc8be47e81568629f8ae9135ab2219de0180c04ac
systemctl: add is-failed

Adds is-failed to join is-active and is-enabled.

I grabbed this one from the todo list. Most of the functionality was
already there for is-active. I just needed to make check_one_unit take
the states to check for as an argument instead of the hardcoded
"active" and "reloading".

is-failed will return 1 if none of the units given are failed. This is
different from is-active which will return 3 if none of the units
given are active. It returns 3 with this comment:
/* According to LSB: "program is not running" */
As that does not make sense when looking for failed units I simply
chose 1 instead.
TODO
man/systemctl.xml
shell-completion/systemd-bash-completion.sh
shell-completion/systemd-zsh-completion.zsh
src/systemctl/systemctl.c