summaryrefslogtreecommitdiff
path: root/src/systemctl.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-02-03 02:01:35 +0100
committerLennart Poettering <lennart@poettering.net>2012-02-03 05:06:03 +0100
commitf42806df7de0f4669c1296ab66a7f8d8784dd0f2 (patch)
tree1370ad4cae0c1509aefdff30e4ebcd443bb010ed /src/systemctl.c
parent680a1dbc354b2f437b4e06e27d4c43217977efdf (diff)
service: replace "failure" boolean by enum, and export it
This should give admins more useful hints why a service failed.
Diffstat (limited to 'src/systemctl.c')
-rw-r--r--src/systemctl.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/systemctl.c b/src/systemctl.c
index 5ad81fd6ca..12264f8ba7 100644
--- a/src/systemctl.c
+++ b/src/systemctl.c
@@ -1437,9 +1437,9 @@ static int wait_for_jobs(DBusConnection *bus, Set *s) {
else if (streq(d.result, "canceled"))
log_error("Job canceled.");
else if (streq(d.result, "dependency"))
- log_error("A dependency job failed. See system logs for details.");
+ log_error("A dependency job failed. See system journal for details.");
else if (!streq(d.result, "done") && !streq(d.result, "skipped"))
- log_error("Job failed. See system logs and 'systemctl status' for details.");
+ log_error("Job failed. See system journal and 'systemctl status' for details.");
}
if (streq_ptr(d.result, "timeout"))
@@ -2003,6 +2003,7 @@ typedef struct UnitStatusInfo {
const char *default_control_group;
const char *load_error;
+ const char *result;
usec_t inactive_exit_timestamp;
usec_t inactive_exit_timestamp_monotonic;
@@ -2106,6 +2107,9 @@ static void print_status_info(UnitStatusInfo *i) {
strna(i->active_state),
off);
+ if (!isempty(i->result) && !streq(i->result, "success"))
+ printf(" (Result: %s)", i->result);
+
timestamp = (streq_ptr(i->active_state, "active") ||
streq_ptr(i->active_state, "reloading")) ? i->active_enter_timestamp :
(streq_ptr(i->active_state, "inactive") ||
@@ -2325,6 +2329,8 @@ static int status_property(const char *name, DBusMessageIter *iter, UnitStatusIn
i->following = s;
else if (streq(name, "UnitFileState"))
i->unit_file_state = s;
+ else if (streq(name, "Result"))
+ i->result = s;
}
break;