summaryrefslogtreecommitdiff
path: root/src/grp-system/systemctl
diff options
context:
space:
mode:
Diffstat (limited to 'src/grp-system/systemctl')
-rw-r--r--src/grp-system/systemctl/systemctl.c103
1 files changed, 53 insertions, 50 deletions
diff --git a/src/grp-system/systemctl/systemctl.c b/src/grp-system/systemctl/systemctl.c
index 0f115db14c..1c25fb5b5f 100644
--- a/src/grp-system/systemctl/systemctl.c
+++ b/src/grp-system/systemctl/systemctl.c
@@ -36,56 +36,56 @@
#include <systemd/sd-daemon.h>
#include <systemd/sd-login.h>
-#include "basic/alloc-util.h"
-#include "basic/cgroup-util.h"
-#include "basic/copy.h"
-#include "basic/env-util.h"
-#include "basic/exit-status.h"
-#include "basic/fd-util.h"
-#include "basic/fileio.h"
-#include "basic/formats-util.h"
-#include "basic/fs-util.h"
-#include "basic/glob-util.h"
-#include "basic/hostname-util.h"
-#include "basic/io-util.h"
-#include "basic/list.h"
-#include "basic/locale-util.h"
-#include "basic/log.h"
-#include "basic/macro.h"
-#include "basic/mkdir.h"
-#include "basic/parse-util.h"
-#include "basic/path-util.h"
-#include "basic/process-util.h"
-#include "basic/rlimit-util.h"
-#include "basic/set.h"
-#include "basic/sigbus.h"
-#include "basic/signal-util.h"
-#include "basic/socket-util.h"
-#include "basic/special.h"
-#include "basic/stat-util.h"
-#include "basic/strv.h"
-#include "basic/terminal-util.h"
-#include "basic/unit-name.h"
-#include "basic/user-util.h"
-#include "basic/util.h"
-#include "basic/verbs.h"
-#include "basic/virt.h"
#include "sd-bus/bus-common-errors.h"
#include "sd-bus/bus-error.h"
#include "sd-bus/bus-message.h"
-#include "shared/bus-unit-util.h"
-#include "shared/bus-util.h"
-#include "shared/cgroup-show.h"
-#include "shared/dropin.h"
-#include "shared/efivars.h"
-#include "shared/initreq.h"
-#include "shared/install.h"
-#include "shared/logs-show.h"
-#include "shared/pager.h"
-#include "shared/path-lookup.h"
-#include "shared/spawn-ask-password-agent.h"
-#include "shared/spawn-polkit-agent.h"
-#include "shared/utmp-wtmp.h"
+#include "systemd-basic/alloc-util.h"
+#include "systemd-basic/cgroup-util.h"
+#include "systemd-basic/copy.h"
+#include "systemd-basic/env-util.h"
+#include "systemd-basic/exit-status.h"
+#include "systemd-basic/fd-util.h"
+#include "systemd-basic/fileio.h"
+#include "systemd-basic/formats-util.h"
+#include "systemd-basic/fs-util.h"
+#include "systemd-basic/glob-util.h"
+#include "systemd-basic/hostname-util.h"
+#include "systemd-basic/io-util.h"
+#include "systemd-basic/list.h"
+#include "systemd-basic/locale-util.h"
+#include "systemd-basic/log.h"
+#include "systemd-basic/macro.h"
+#include "systemd-basic/mkdir.h"
+#include "systemd-basic/parse-util.h"
+#include "systemd-basic/path-util.h"
+#include "systemd-basic/process-util.h"
+#include "systemd-basic/rlimit-util.h"
+#include "systemd-basic/set.h"
+#include "systemd-basic/sigbus.h"
+#include "systemd-basic/signal-util.h"
+#include "systemd-basic/socket-util.h"
+#include "systemd-basic/special.h"
+#include "systemd-basic/stat-util.h"
+#include "systemd-basic/strv.h"
+#include "systemd-basic/terminal-util.h"
+#include "systemd-basic/unit-name.h"
+#include "systemd-basic/user-util.h"
+#include "systemd-basic/util.h"
+#include "systemd-basic/verbs.h"
+#include "systemd-basic/virt.h"
+#include "systemd-shared/bus-unit-util.h"
+#include "systemd-shared/bus-util.h"
+#include "systemd-shared/cgroup-show.h"
+#include "systemd-shared/dropin.h"
+#include "systemd-shared/efivars.h"
+#include "systemd-shared/initreq.h"
+#include "systemd-shared/install.h"
+#include "systemd-shared/logs-show.h"
+#include "systemd-shared/pager.h"
+#include "systemd-shared/path-lookup.h"
+#include "systemd-shared/spawn-ask-password-agent.h"
+#include "systemd-shared/spawn-polkit-agent.h"
+#include "systemd-shared/utmp-wtmp.h"
/* The init script exit status codes
0 program is running or service is OK
@@ -4686,12 +4686,14 @@ static int show_one(
return log_error_errno(r, "Failed to map properties: %s", bus_error_message(&error, r));
if (streq_ptr(info.load_state, "not-found") && streq_ptr(info.active_state, "inactive")) {
- log_error("Unit %s could not be found.", unit);
+ log_full(streq(verb, "status") ? LOG_ERR : LOG_DEBUG,
+ "Unit %s could not be found.", unit);
if (streq(verb, "status"))
return EXIT_PROGRAM_OR_SERVICES_STATUS_UNKNOWN;
- return -ENOENT;
+ if (!streq(verb, "show"))
+ return -ENOENT;
}
r = sd_bus_message_rewind(reply, true);
@@ -4756,10 +4758,11 @@ static int show_one(
r = 0;
if (show_properties) {
char **pp;
+ int not_found_level = streq(verb, "show") ? LOG_DEBUG : LOG_WARNING;
STRV_FOREACH(pp, arg_properties)
if (!set_contains(found_properties, *pp)) {
- log_warning("Property %s does not exist.", *pp);
+ log_full(not_found_level, "Property %s does not exist.", *pp);
r = -ENXIO;
}