Commit 983d9c90 authored by Lennart Poettering's avatar Lennart Poettering
Browse files

units: turn Wants=shutdown back into Requires=shutdown to avoid removal of...

units: turn Wants=shutdown back into Requires=shutdown to avoid removal of jobs due to the impact minimizer
parent 51bc5d4b
......@@ -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) {
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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]
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
[Unit]
Description=Exit
DefaultDependencies=no
Wants=shutdown.target
Requires=shutdown.target
After=shutdown.target
[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
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment