From b41b9d2ae9d1139a3d4d5eb7ad7b100ffa3ee6db Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 8 Oct 2015 16:15:38 +0200 Subject: systemctl: add a way to explicitly request client-side unit installing This adds support for a new environment variable SYSTEMCTL_INSTALL_CLIENT_SIDE, that ensures that systemctl executes install operations client-side instead of passing them to PID1. This is useful in debugging situations, but even beyond that. However, we don't want to make it official API, hence let's just make it an undocumented environment variable. Similar, add a second variable, SYSTEMCTL_SKIP_SYSV which allows skipping the SysV chkconfig fall-back if set. This is useful for similar reasons, and exposed as undocumented as environment variable for similar reasons, too. --- src/basic/env-util.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/basic/env-util.c') diff --git a/src/basic/env-util.c b/src/basic/env-util.c index 94cb251698..9ddac5d6a1 100644 --- a/src/basic/env-util.c +++ b/src/basic/env-util.c @@ -25,6 +25,7 @@ #include "alloc-util.h" #include "def.h" #include "env-util.h" +#include "parse-util.h" #include "string-util.h" #include "strv.h" #include "utf8.h" @@ -594,3 +595,13 @@ char **replace_env_argv(char **argv, char **env) { ret[k] = NULL; return ret; } + +int getenv_bool(const char *p) { + const char *e; + + e = getenv(p); + if (!e) + return -ENXIO; + + return parse_boolean(e); +} -- cgit v1.2.3-54-g00ecf