X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=src%2Fcore%2Ftarget.c;h=3cb17b9843489b7943a378a14e02a35e7284c723;hb=b80fc61e8971283606f9cd0a48e31d0f701c82f1;hp=3519b4b653a05b1a4b6ca63bc42811e3c67ce083;hpb=03d298e1e549fb20cd495520cc7ff0fddcb636c7;p=thirdparty%2Fsystemd.git diff --git a/src/core/target.c b/src/core/target.c index 3519b4b653a..3cb17b98434 100644 --- a/src/core/target.c +++ b/src/core/target.c @@ -66,7 +66,16 @@ static int target_add_default_dependencies(Target *t) { return 0; /* Make sure targets are unloaded on shutdown */ - return unit_add_two_dependencies_by_name(UNIT(t), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_SHUTDOWN_TARGET, true, UNIT_DEPENDENCY_DEFAULT); + if (!UNIT(t)->ignore_on_soft_reboot) + return unit_add_two_dependencies_by_name( + UNIT(t), + UNIT_BEFORE, UNIT_CONFLICTS, + SPECIAL_SHUTDOWN_TARGET, true, + UNIT_DEPENDENCY_DEFAULT); + + /* Unless we are meant to survive soft reboot, in which case we need to conflict with + * non-soft-reboot targets. */ + return unit_add_dependencies_on_real_shutdown_targets(UNIT(t)); } static int target_load(Unit *u) {