chiark / gitweb /
target: implicitly shutdown targets on shutdown, so that they are pulled into the...
authorLennart Poettering <lennart@poettering.net>
Thu, 2 Sep 2010 23:42:19 +0000 (01:42 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 2 Sep 2010 23:42:57 +0000 (01:42 +0200)
src/target.c
units/halt.target
units/poweroff.target
units/reboot.target
units/shutdown.target

index c350d8f..1118693 100644 (file)
@@ -75,7 +75,8 @@ static int target_add_default_dependencies(Target *t) {
                         if ((r = unit_add_dependency(UNIT(t), UNIT_AFTER, other, true)) < 0)
                                 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) {
index 70e90fe..04b42cd 100644 (file)
@@ -9,6 +9,7 @@
 
 [Unit]
 Description=Halt
+DefaultDependencies=no
 Requires=halt.service
 After=halt.service
 AllowIsolate=yes
index cb94606..975b088 100644 (file)
@@ -9,6 +9,7 @@
 
 [Unit]
 Description=Power-Off
+DefaultDependencies=no
 Names=runlevel0.target
 Requires=poweroff.service
 After=poweroff.service
index 8557513..2cd46a0 100644 (file)
@@ -9,6 +9,7 @@
 
 [Unit]
 Description=Reboot
+DefaultDependencies=no
 Names=runlevel6.target
 Requires=reboot.service
 After=reboot.service
index 6d1fb6f..4db9f1f 100644 (file)
@@ -9,5 +9,6 @@
 
 [Unit]
 Description=Shutdown
+DefaultDependencies=no
 RefuseManualStart=yes
 IgnoreDependencyFailure=yes