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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -47,3 +47,5 @@ char **strv_env_unset_many(char **l, ...) _sentinel_;
|
||||
|
||||
char *strv_env_get_n(char **l, const char *name, size_t k) _pure_;
|
||||
char *strv_env_get(char **x, const char *n) _pure_;
|
||||
|
||||
int getenv_bool(const char *p);
|
||||
|
||||
Reference in New Issue
Block a user