diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/target.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/target.c b/src/core/target.c index 765c1f3fa4..ff0d764fb5 100644 --- a/src/core/target.c +++ b/src/core/target.c @@ -75,8 +75,11 @@ static int target_add_default_dependencies(Target *t) { return r; } + if (unit_has_name(UNIT(t), SPECIAL_SHUTDOWN_TARGET)) + return 0; + /* Make sure targets are unloaded on shutdown */ - return unit_add_dependency_by_name(UNIT(t), UNIT_CONFLICTS, SPECIAL_SHUTDOWN_TARGET, NULL, true); + return unit_add_two_dependencies_by_name(UNIT(t), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_SHUTDOWN_TARGET, NULL, true); } static int target_load(Unit *u) { |