target: implicitly shutdown targets on shutdown, so that they are pulled into the final transaction and may be used for synchronization
This commit is contained in:
parent
7f97f0fee4
commit
b401e1fb9d
|
@ -75,7 +75,8 @@ static int target_add_default_dependencies(Target *t) {
|
||||||
if ((r = unit_add_dependency(UNIT(t), UNIT_AFTER, other, true)) < 0)
|
if ((r = unit_add_dependency(UNIT(t), UNIT_AFTER, other, true)) < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
return 0;
|
/* Make sure targets are unloaded on shutdown */
|
||||||
|
return unit_add_dependency_by_name(UNIT(t), UNIT_CONFLICTED_BY, SPECIAL_SHUTDOWN_TARGET, NULL, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int target_add_getty_dependencies(Target *t) {
|
static int target_add_getty_dependencies(Target *t) {
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Halt
|
Description=Halt
|
||||||
|
DefaultDependencies=no
|
||||||
Requires=halt.service
|
Requires=halt.service
|
||||||
After=halt.service
|
After=halt.service
|
||||||
AllowIsolate=yes
|
AllowIsolate=yes
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Power-Off
|
Description=Power-Off
|
||||||
|
DefaultDependencies=no
|
||||||
Names=runlevel0.target
|
Names=runlevel0.target
|
||||||
Requires=poweroff.service
|
Requires=poweroff.service
|
||||||
After=poweroff.service
|
After=poweroff.service
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Reboot
|
Description=Reboot
|
||||||
|
DefaultDependencies=no
|
||||||
Names=runlevel6.target
|
Names=runlevel6.target
|
||||||
Requires=reboot.service
|
Requires=reboot.service
|
||||||
After=reboot.service
|
After=reboot.service
|
||||||
|
|
|
@ -9,5 +9,6 @@
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Shutdown
|
Description=Shutdown
|
||||||
|
DefaultDependencies=no
|
||||||
RefuseManualStart=yes
|
RefuseManualStart=yes
|
||||||
IgnoreDependencyFailure=yes
|
IgnoreDependencyFailure=yes
|
||||||
|
|
Loading…
Reference in New Issue