]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: add env var to force connection to system manager via the bus
authorLennart Poettering <lennart@poettering.net>
Wed, 16 Nov 2016 13:31:03 +0000 (14:31 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 16 Nov 2016 14:03:26 +0000 (15:03 +0100)
Sometimes it is useful for debugging purposes to force systemctl to connect to
PID 1 via the bus instead of direct connection, even if the direct connection
is possible.

src/systemctl/systemctl.c

index 49a97ff268d6c04a58d4aef2a85e63747890ae41..de7e19725c79f972181710efe28d8b6614b020ba 100644 (file)
@@ -204,6 +204,9 @@ static int acquire_bus(BusFocus focus, sd_bus **ret) {
         if (arg_transport != BUS_TRANSPORT_LOCAL)
                 focus = BUS_FULL;
 
+        if (getenv_bool("SYSTEMCTL_FORCE_BUS") > 0)
+                focus = BUS_FULL;
+
         if (!busses[focus]) {
                 bool user;