chiark / gitweb /
units: turn Wants=shutdown back into Requires=shutdown to avoid removal of jobs due...
authorLennart Poettering <lennart@poettering.net>
Sun, 11 Jul 2010 02:22:00 +0000 (04:22 +0200)
committerLennart Poettering <lennart@poettering.net>
Sun, 11 Jul 2010 02:22:00 +0000 (04:22 +0200)
15 files changed:
src/systemctl.c
units/arch/halt.service
units/arch/poweroff.service
units/arch/reboot.service
units/emergency.service
units/fedora/halt.service
units/fedora/poweroff.service
units/fedora/reboot.service
units/gentoo/halt.service
units/gentoo/poweroff.service
units/gentoo/reboot.service
units/session/exit.service.in
units/suse/halt.service
units/suse/poweroff.service
units/suse/reboot.service

index d033a75..d1892e4 100644 (file)
@@ -794,12 +794,17 @@ finish:
 }
 
 static int start_special(DBusConnection *bus, char **args, unsigned n) {
+        int r;
+
         assert(bus);
         assert(args);
 
-        warn_wall(verb_to_action(args[0]));
+        r = start_unit(bus, args, n);
+
+        if (r >= 0)
+                warn_wall(verb_to_action(args[0]));
 
-        return start_unit(bus, args, n);
+        return r;
 }
 
 static int check_unit(DBusConnection *bus, char **args, unsigned n) {
@@ -3292,26 +3297,29 @@ static int reload_with_fallback(DBusConnection *bus) {
 static int start_with_fallback(DBusConnection *bus) {
         int r;
 
-        warn_wall(arg_action);
 
         if (bus) {
                 /* First, try systemd via D-Bus. */
                 if ((r = start_unit(bus, NULL, 0)) > 0)
-                        return 0;
+                        goto done;
 
                 /* Hmm, talking to systemd via D-Bus didn't work. Then
                  * let's try to talk to Upstart via D-Bus. */
                 if ((r = talk_upstart()) > 0)
-                        return 0;
+                        goto done;
         }
 
         /* Nothing else worked, so let's try
          * /dev/initctl */
         if ((r = talk_initctl()) != 0)
-                return 0;
+                goto done;
 
         log_error("Failed to talk to init daemon.");
         return -EIO;
+
+done:
+        warn_wall(arg_action);
+        return 0;
 }
 
 static int halt_main(DBusConnection *bus) {
index 190e4fe..87224e3 100644 (file)
@@ -8,7 +8,7 @@
 [Unit]
 Description=Halt
 DefaultDependencies=no
-Wants=shutdown.target
+Requires=shutdown.target
 After=shutdown.target
 Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount
 
index 0b1ee89..ffa592c 100644 (file)
@@ -8,7 +8,7 @@
 [Unit]
 Description=Power-Off
 DefaultDependencies=no
-Wants=shutdown.target
+Requires=shutdown.target
 After=shutdown.target
 Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount
 
index 274f407..934903d 100644 (file)
@@ -8,7 +8,7 @@
 [Unit]
 Description=Reboot
 DefaultDependencies=no
-Wants=shutdown.target
+Requires=shutdown.target
 After=shutdown.target
 Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount
 
index 0014c26..bcedebf 100644 (file)
@@ -10,7 +10,7 @@
 [Unit]
 Description=Emergency Shell
 DefaultDependencies=no
-Wants=shutdown.target umount.target
+Requires=shutdown.target umount.target
 After=shutdown.target umount.target
 
 [Service]
index 0c0fa5f..b957a3f 100644 (file)
@@ -8,7 +8,7 @@
 [Unit]
 Description=Halt
 DefaultDependencies=no
-Wants=shutdown.target killall.service
+Requires=shutdown.target killall.service
 After=shutdown.target killall.service
 Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount
 
index 913edc4..76d030c 100644 (file)
@@ -8,7 +8,7 @@
 [Unit]
 Description=Power-Off
 DefaultDependencies=no
-Wants=shutdown.target killall.service
+Requires=shutdown.target killall.service
 After=shutdown.target killall.service
 Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount
 
index c81b13e..6a93c0b 100644 (file)
@@ -8,7 +8,7 @@
 [Unit]
 Description=Reboot
 DefaultDependencies=no
-Wants=shutdown.target killall.service
+Requires=shutdown.target killall.service
 After=shutdown.target killall.service
 Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount
 
index 28db813..19ead8a 100644 (file)
@@ -8,7 +8,7 @@
 [Unit]
 Description=Halt
 DefaultDependencies=no
-Wants=shutdown.target killall.service
+Requires=shutdown.target killall.service
 After=shutdown.target killall.service
 Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount
 
index da6f48f..9ceb205 100644 (file)
@@ -8,7 +8,7 @@
 [Unit]
 Description=Power-Off
 DefaultDependencies=no
-Wants=shutdown.target killall.service
+Requires=shutdown.target killall.service
 After=shutdown.target killall.service
 Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount
 
index a0f3575..c223e6c 100644 (file)
@@ -8,7 +8,7 @@
 [Unit]
 Description=Reboot
 DefaultDependencies=no
-Wants=shutdown.target killall.service
+Requires=shutdown.target killall.service
 After=shutdown.target killall.service
 Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount
 
index 3e5b5bf..1f515a7 100644 (file)
@@ -1,7 +1,7 @@
 [Unit]
 Description=Exit
 DefaultDependencies=no
-Wants=shutdown.target
+Requires=shutdown.target
 After=shutdown.target
 
 [Service]
index 00bbfa9..5f42ac6 100644 (file)
@@ -8,7 +8,7 @@
 [Unit]
 Description=Halt
 DefaultDependencies=no
-Wants=shutdown.target
+Requires=shutdown.target
 After=shutdown.target
 Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount
 
index e9aff27..93a9da5 100644 (file)
@@ -8,7 +8,7 @@
 [Unit]
 Description=Power-Off
 DefaultDependencies=no
-Wants=shutdown.target
+Requires=shutdown.target
 After=shutdown.target
 Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount
 
index e9b76b6..c3526b3 100644 (file)
@@ -8,7 +8,7 @@
 [Unit]
 Description=Reboot
 DefaultDependencies=no
-Wants=shutdown.target
+Requires=shutdown.target
 After=shutdown.target
 Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount