summaryrefslogtreecommitdiff
path: root/src/shared/condition.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-10-21 22:56:58 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-10-26 20:12:52 -0400
commit239a5707e1bd7740b075e78a4837a77f1129cdaa (patch)
treebd6b7b814e55489122a0403f6546802d157bfa52 /src/shared/condition.c
parent299a34c11a4241f8c5832ccd5a7bc13263f8488b (diff)
shared/condition: add ConditionVirtualization=[!]private-users
This can be useful to silence warnings about units which fail in userns container.
Diffstat (limited to 'src/shared/condition.c')
-rw-r--r--src/shared/condition.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/shared/condition.c b/src/shared/condition.c
index f13fa6a9fd..376606e004 100644
--- a/src/shared/condition.c
+++ b/src/shared/condition.c
@@ -146,6 +146,9 @@ static int condition_test_virtualization(Condition *c) {
assert(c->parameter);
assert(c->type == CONDITION_VIRTUALIZATION);
+ if (streq(c->parameter, "private-users"))
+ return running_in_userns();
+
v = detect_virtualization();
if (v < 0)
return v;