diff options
author | Kay Sievers <kay@vrfy.org> | 2013-11-07 14:14:22 +0100 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2013-11-07 14:14:22 +0100 |
commit | 8be28fb1e0aa57b2a6ba7736440c9bba54cb86d1 (patch) | |
tree | 359148a2fe418c37023150c9ebed6e3825b4ef3d | |
parent | 86198b2788e56fd05959c2dce670d1646bf99bcd (diff) |
core: fix require $XDG_RUNTIME_DIR
$ sudo dracut -f
Trying to run as user instance, but $XDG_RUNTIME_DIR is not set.
/usr/lib/dracut/modules.d/98systemd/module-setup.sh: line 10:
((: >= 198 : syntax error: operand expected (error token is ">= 198 ")
-rw-r--r-- | src/core/main.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/main.c b/src/core/main.c index ec7758db12..8abad6d257 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -1383,12 +1383,6 @@ int main(int argc, char *argv[]) { goto finish; } - if (arg_running_as == SYSTEMD_USER && - !getenv("XDG_RUNTIME_DIR")) { - log_error("Trying to run as user instance, but $XDG_RUNTIME_DIR is not set."); - goto finish; - } - if (arg_running_as == SYSTEMD_SYSTEM && arg_action == ACTION_RUN && running_in_chroot() > 0) { @@ -1411,6 +1405,12 @@ int main(int argc, char *argv[]) { goto finish; } + if (arg_running_as == SYSTEMD_USER && + !getenv("XDG_RUNTIME_DIR")) { + log_error("Trying to run as user instance, but $XDG_RUNTIME_DIR is not set."); + goto finish; + } + assert_se(arg_action == ACTION_RUN || arg_action == ACTION_TEST); /* Close logging fds, in order not to confuse fdset below */ |