From d4015567adf77d4b992dc6fae84445e4e09c236e Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 16 Nov 2016 14:31:03 +0100 Subject: [PATCH] systemctl: add env var to force connection to system manager via the bus 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 49a97ff..de7e197 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -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; -- 2.7.4