summaryrefslogtreecommitdiff
path: root/src/systemctl.c
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2011-11-22 15:45:34 -0500
committerMichal Schmidt <mschmidt@redhat.com>2011-12-05 22:04:42 +0100
commitd380a3bcd14376ed72286e78dbcc871b7d6d2151 (patch)
tree095eb202adbbd0a65957fbf3122673f1278bdccb /src/systemctl.c
parent2096e009a790073a934f5cd07d17024d3b199d0b (diff)
Allow 'list-unit-files' to run with --root.
To do so, move the check for the bus to the bus-using portion of list_unit_files(), and ensure that get_config_path doesn't abort when checking the runtime path with --root.
Diffstat (limited to 'src/systemctl.c')
-rw-r--r--src/systemctl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/systemctl.c b/src/systemctl.c
index 7373e64e8c..b940c9c64e 100644
--- a/src/systemctl.c
+++ b/src/systemctl.c
@@ -622,8 +622,6 @@ static int list_unit_files(DBusConnection *bus, char **args) {
dbus_error_init(&error);
- assert(bus);
-
pager_open_if_enabled();
if (avoid_bus()) {
@@ -659,6 +657,8 @@ static int list_unit_files(DBusConnection *bus, char **args) {
hashmap_free(h);
} else {
+ assert(bus);
+
m = dbus_message_new_method_call(
"org.freedesktop.systemd1",
"/org/freedesktop/systemd1",
@@ -5001,6 +5001,7 @@ static int systemctl_main(DBusConnection *bus, int argc, char *argv[], DBusError
if (!streq(verbs[i].verb, "enable") &&
!streq(verbs[i].verb, "disable") &&
!streq(verbs[i].verb, "is-enable") &&
+ !streq(verbs[i].verb, "list-unit-files") &&
!streq(verbs[i].verb, "reenable") &&
!streq(verbs[i].verb, "preset") &&
!streq(verbs[i].verb, "mask") &&