From: Lennart Poettering Date: Mon, 25 Jun 2018 14:22:48 +0000 (+0200) Subject: systemctl: log errors to LOG_DEBUG rather than eating them up entirely X-Git-Tag: v240~1041^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e686a616e8854765cbe9ea8cdebc94cc0ce94ea5;p=thirdparty%2Fsystemd.git systemctl: log errors to LOG_DEBUG rather than eating them up entirely --- diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index cc70e43717f..ca886a845ef 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -6591,6 +6591,7 @@ static int unit_is_enabled(int argc, char *argv[], void *userdata) { } static int is_system_running(int argc, char *argv[], void *userdata) { + _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL; _cleanup_free_ char *state = NULL; sd_bus *bus; int r; @@ -6611,9 +6612,11 @@ static int is_system_running(int argc, char *argv[], void *userdata) { "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager", "SystemState", - NULL, + &error, &state); if (r < 0) { + log_debug_errno(r, "Failed to query system state: %s", bus_error_message(&error, r)); + if (!arg_quiet) puts("unknown"); return 0;