summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-04-24 17:28:06 +0200
committerLennart Poettering <lennart@poettering.net>2015-04-24 17:28:31 +0200
commit47bc12e1ba35d38edda737dae232088d6d3ae688 (patch)
treec29cacc5cde8a5764c521e2aee6e97162407c3cb /src
parent658f26b828fdd7007cfe82d794f610525b21cb99 (diff)
unit: don't add automatic dependencies on device units if they aren't supported
http://lists.freedesktop.org/archives/systemd-devel/2015-April/031187.html
Diffstat (limited to 'src')
-rw-r--r--src/core/unit.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index 2b356e2854..730492e226 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -2846,14 +2846,18 @@ int unit_add_node_link(Unit *u, const char *what, bool wants) {
assert(u);
- if (!what)
- return 0;
-
/* Adds in links to the device node that this unit is based on */
+ if (isempty(what))
+ return 0;
if (!is_device_path(what))
return 0;
+ /* When device units aren't supported (such as in a
+ * container), don't create dependencies on them. */
+ if (unit_vtable[UNIT_DEVICE]->supported && !unit_vtable[UNIT_DEVICE]->supported(u->manager))
+ return 0;
+
e = unit_name_from_path(what, ".device");
if (!e)
return -ENOMEM;