summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/systemctl.c20
-rw-r--r--units/arch/halt.service2
-rw-r--r--units/arch/poweroff.service2
-rw-r--r--units/arch/reboot.service2
-rw-r--r--units/emergency.service2
-rw-r--r--units/fedora/halt.service2
-rw-r--r--units/fedora/poweroff.service2
-rw-r--r--units/fedora/reboot.service2
-rw-r--r--units/gentoo/halt.service2
-rw-r--r--units/gentoo/poweroff.service2
-rw-r--r--units/gentoo/reboot.service2
-rw-r--r--units/session/exit.service.in2
-rw-r--r--units/suse/halt.service2
-rw-r--r--units/suse/poweroff.service2
-rw-r--r--units/suse/reboot.service2
15 files changed, 28 insertions, 20 deletions
diff --git a/src/systemctl.c b/src/systemctl.c
index d033a75280..d1892e4ae0 100644
--- a/src/systemctl.c
+++ b/src/systemctl.c
@@ -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) {
diff --git a/units/arch/halt.service b/units/arch/halt.service
index 190e4fee89..87224e34b6 100644
--- a/units/arch/halt.service
+++ b/units/arch/halt.service
@@ -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
diff --git a/units/arch/poweroff.service b/units/arch/poweroff.service
index 0b1ee89aa6..ffa592c8f6 100644
--- a/units/arch/poweroff.service
+++ b/units/arch/poweroff.service
@@ -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
diff --git a/units/arch/reboot.service b/units/arch/reboot.service
index 274f4075f2..934903dc6b 100644
--- a/units/arch/reboot.service
+++ b/units/arch/reboot.service
@@ -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
diff --git a/units/emergency.service b/units/emergency.service
index 0014c263b4..bcedebfa08 100644
--- a/units/emergency.service
+++ b/units/emergency.service
@@ -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]
diff --git a/units/fedora/halt.service b/units/fedora/halt.service
index 0c0fa5fa38..b957a3fe30 100644
--- a/units/fedora/halt.service
+++ b/units/fedora/halt.service
@@ -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
diff --git a/units/fedora/poweroff.service b/units/fedora/poweroff.service
index 913edc489f..76d030c041 100644
--- a/units/fedora/poweroff.service
+++ b/units/fedora/poweroff.service
@@ -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
diff --git a/units/fedora/reboot.service b/units/fedora/reboot.service
index c81b13ecd9..6a93c0b557 100644
--- a/units/fedora/reboot.service
+++ b/units/fedora/reboot.service
@@ -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
diff --git a/units/gentoo/halt.service b/units/gentoo/halt.service
index 28db813fb3..19ead8a315 100644
--- a/units/gentoo/halt.service
+++ b/units/gentoo/halt.service
@@ -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
diff --git a/units/gentoo/poweroff.service b/units/gentoo/poweroff.service
index da6f48f749..9ceb205b05 100644
--- a/units/gentoo/poweroff.service
+++ b/units/gentoo/poweroff.service
@@ -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
diff --git a/units/gentoo/reboot.service b/units/gentoo/reboot.service
index a0f3575385..c223e6c26f 100644
--- a/units/gentoo/reboot.service
+++ b/units/gentoo/reboot.service
@@ -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
diff --git a/units/session/exit.service.in b/units/session/exit.service.in
index 3e5b5bff71..1f515a75ce 100644
--- a/units/session/exit.service.in
+++ b/units/session/exit.service.in
@@ -1,7 +1,7 @@
[Unit]
Description=Exit
DefaultDependencies=no
-Wants=shutdown.target
+Requires=shutdown.target
After=shutdown.target
[Service]
diff --git a/units/suse/halt.service b/units/suse/halt.service
index 00bbfa93f4..5f42ac691f 100644
--- a/units/suse/halt.service
+++ b/units/suse/halt.service
@@ -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
diff --git a/units/suse/poweroff.service b/units/suse/poweroff.service
index e9aff275d4..93a9da502a 100644
--- a/units/suse/poweroff.service
+++ b/units/suse/poweroff.service
@@ -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
diff --git a/units/suse/reboot.service b/units/suse/reboot.service
index e9b76b61db..c3526b3035 100644
--- a/units/suse/reboot.service
+++ b/units/suse/reboot.service
@@ -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