From 1a0fce458d3b45624c5817006735d59a5689ef83 Mon Sep 17 00:00:00 2001 From: Thomas Hindoe Paaboel Andersen Date: Thu, 27 Dec 2012 17:39:48 +0100 Subject: 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. --- man/systemctl.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'man') diff --git a/man/systemctl.xml b/man/systemctl.xml index 62446d7a57..f86952c683 100644 --- a/man/systemctl.xml +++ b/man/systemctl.xml @@ -198,6 +198,7 @@ STDOUT in snapshot, is-active, + is-failed, enable and disable. @@ -600,6 +601,18 @@ this will also print the current unit state to STDOUT. + + is-failed [NAME...] + + Check whether any of + the specified units are failed. + Returns an exit code + 0 if at least one is failed, non-zero + otherwise. Unless + is specified + this will also print the current unit + state to STDOUT. + status [NAME...|PID...] -- cgit v1.2.3-54-g00ecf