summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-09-25 08:34:30 -0400
committerMartin Pitt <martin.pitt@ubuntu.com>2016-10-01 22:53:17 +0200
commitdd5e7000cb54f94fdf4756a28144ab32d6e214c8 (patch)
tree2be801b8af593138fa1ec3fd75099ab845839f67 /src/core
parent93a0884126146361ca078ec627da2cf766205a1c (diff)
core: complain if Before= dep on .device is declared
[Unit] Before=foobar.device [Service] ExecStart=/bin/true Type=oneshot $ systemd-analyze verify before-device.service before-device.service: Dependency Before=foobar.device ignored (.device units cannot be delayed)
Diffstat (limited to 'src/core')
-rw-r--r--src/core/unit.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index 5d284a359d..693f75c928 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -2225,6 +2225,11 @@ int unit_add_dependency(Unit *u, UnitDependency d, Unit *other, bool add_referen
return 0;
}
+ if (d == UNIT_BEFORE && other->type == UNIT_DEVICE) {
+ log_unit_warning(u, "Dependency Before=%s ignored (.device units cannot be delayed)", other->id);
+ return 0;
+ }
+
r = set_ensure_allocated(&u->dependencies[d], NULL);
if (r < 0)
return r;