systemd: Start ctrl-alt-del.target irreversibly

This fixes hangs during EC2 reboots (which are implemented by sending
a ctrl-alt-del to the instance).
This commit is contained in:
Eelco Dolstra 2013-05-07 14:26:29 +02:00
parent 0dfb9ecc35
commit 2e77679b0b
10 changed files with 36 additions and 8 deletions

View File

@ -1,7 +1,7 @@
From 8f861550827e750fb56954c3f91a2f565abb42bb Mon Sep 17 00:00:00 2001 From 8f861550827e750fb56954c3f91a2f565abb42bb Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <eelco.dolstra@logicblox.com> From: Eelco Dolstra <eelco.dolstra@logicblox.com>
Date: Tue, 8 Jan 2013 15:44:33 +0100 Date: Tue, 8 Jan 2013 15:44:33 +0100
Subject: [PATCH 1/8] Make "systemctl daemon-reexec" do the right thing on Subject: [PATCH 1/9] Make "systemctl daemon-reexec" do the right thing on
NixOS NixOS
--- ---

View File

@ -1,7 +1,7 @@
From 2afcee0b4da066fb5f8fc00b749d88f5bd9df3d3 Mon Sep 17 00:00:00 2001 From 2afcee0b4da066fb5f8fc00b749d88f5bd9df3d3 Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <eelco.dolstra@logicblox.com> From: Eelco Dolstra <eelco.dolstra@logicblox.com>
Date: Tue, 8 Jan 2013 15:45:01 +0100 Date: Tue, 8 Jan 2013 15:45:01 +0100
Subject: [PATCH 2/8] Ignore duplicate paths in "systemctl start" Subject: [PATCH 2/9] Ignore duplicate paths in "systemctl start"
--- ---
src/systemctl/systemctl.c | 2 +- src/systemctl/systemctl.c | 2 +-

View File

@ -1,7 +1,7 @@
From b288ca7d376e3a78368a2b59529ebe5ba812babf Mon Sep 17 00:00:00 2001 From b288ca7d376e3a78368a2b59529ebe5ba812babf Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <eelco.dolstra@logicblox.com> From: Eelco Dolstra <eelco.dolstra@logicblox.com>
Date: Tue, 8 Jan 2013 15:46:30 +0100 Date: Tue, 8 Jan 2013 15:46:30 +0100
Subject: [PATCH 3/8] Start device units for uninitialised encrypted devices Subject: [PATCH 3/9] Start device units for uninitialised encrypted devices
This is necessary because the NixOS service that initialises the This is necessary because the NixOS service that initialises the
filesystem depends on the appearance of the device unit. Also, this filesystem depends on the appearance of the device unit. Also, this

View File

@ -1,7 +1,7 @@
From 7a498e661f3d111fa09700a6cfa62cfd6733b1cc Mon Sep 17 00:00:00 2001 From 7a498e661f3d111fa09700a6cfa62cfd6733b1cc Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <eelco.dolstra@logicblox.com> From: Eelco Dolstra <eelco.dolstra@logicblox.com>
Date: Tue, 8 Jan 2013 15:48:19 +0100 Date: Tue, 8 Jan 2013 15:48:19 +0100
Subject: [PATCH 4/8] Set switch-to-configuration hints for some units Subject: [PATCH 4/9] Set switch-to-configuration hints for some units
MIME-Version: 1.0 MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8 Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit Content-Transfer-Encoding: 8bit

View File

@ -1,7 +1,7 @@
From e6bbe5fa858bd8196c8e1f264904679e6bda426d Mon Sep 17 00:00:00 2001 From e6bbe5fa858bd8196c8e1f264904679e6bda426d Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <eelco.dolstra@logicblox.com> From: Eelco Dolstra <eelco.dolstra@logicblox.com>
Date: Tue, 8 Jan 2013 15:56:03 +0100 Date: Tue, 8 Jan 2013 15:56:03 +0100
Subject: [PATCH 5/8] sysinit.target: Drop the dependency on local-fs.target Subject: [PATCH 5/9] sysinit.target: Drop the dependency on local-fs.target
and swap.target and swap.target
Having all services with DefaultDependencies=yes depend on Having all services with DefaultDependencies=yes depend on

View File

@ -1,7 +1,7 @@
From 4731a9074538e9e24d2b81fc737917b064e194e6 Mon Sep 17 00:00:00 2001 From 4731a9074538e9e24d2b81fc737917b064e194e6 Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <eelco.dolstra@logicblox.com> From: Eelco Dolstra <eelco.dolstra@logicblox.com>
Date: Tue, 8 Jan 2013 18:36:28 +0100 Date: Tue, 8 Jan 2013 18:36:28 +0100
Subject: [PATCH 6/8] Don't call "plymouth quit" Subject: [PATCH 6/9] Don't call "plymouth quit"
NixOS doesn't use Plymouth (yet). NixOS doesn't use Plymouth (yet).
--- ---

View File

@ -1,7 +1,7 @@
From f0c362873860526579bf9bda216005fd5a0936dd Mon Sep 17 00:00:00 2001 From f0c362873860526579bf9bda216005fd5a0936dd Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <eelco.dolstra@logicblox.com> From: Eelco Dolstra <eelco.dolstra@logicblox.com>
Date: Mon, 4 Feb 2013 12:41:14 +0100 Date: Mon, 4 Feb 2013 12:41:14 +0100
Subject: [PATCH 7/8] Ignore IPv6 link-local addresses Subject: [PATCH 7/9] Ignore IPv6 link-local addresses
Returning IPv6 link-local addresses is a bad idea, because they only Returning IPv6 link-local addresses is a bad idea, because they only
work if an application connects specifically over the corresponding work if an application connects specifically over the corresponding

View File

@ -1,7 +1,7 @@
From 0112df74e576dd683c132ec33861b7099dc94454 Mon Sep 17 00:00:00 2001 From 0112df74e576dd683c132ec33861b7099dc94454 Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <eelco.dolstra@logicblox.com> From: Eelco Dolstra <eelco.dolstra@logicblox.com>
Date: Fri, 12 Apr 2013 13:16:57 +0200 Date: Fri, 12 Apr 2013 13:16:57 +0200
Subject: [PATCH 8/8] Don't try to unmount /nix or /nix/store Subject: [PATCH 8/9] Don't try to unmount /nix or /nix/store
They'll still be remounted read-only. They'll still be remounted read-only.

View File

@ -0,0 +1,27 @@
From ed7c22c76e1399861ec8e0216f08a7f9419eea50 Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <eelco.dolstra@logicblox.com>
Date: Tue, 7 May 2013 14:03:13 +0200
Subject: [PATCH 9/9] Start ctrl-alt-del.target irreversibly
This makes ctrl-alt-del reboots more robust, just like "systemctl
reboot".
---
src/core/manager.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/manager.c b/src/core/manager.c
index c7f8f20..0508628 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -1372,7 +1372,7 @@ static int manager_process_signal_fd(Manager *m) {
case SIGINT:
if (m->running_as == SYSTEMD_SYSTEM) {
- manager_start_target(m, SPECIAL_CTRL_ALT_DEL_TARGET, JOB_REPLACE);
+ manager_start_target(m, SPECIAL_CTRL_ALT_DEL_TARGET, JOB_REPLACE_IRREVERSIBLY);
break;
}
--
1.8.2.1

View File

@ -22,6 +22,7 @@ stdenv.mkDerivation rec {
./0006-Don-t-call-plymouth-quit.patch ./0006-Don-t-call-plymouth-quit.patch
./0007-Ignore-IPv6-link-local-addresses.patch ./0007-Ignore-IPv6-link-local-addresses.patch
./0008-Don-t-try-to-unmount-nix-or-nix-store.patch ./0008-Don-t-try-to-unmount-nix-or-nix-store.patch
./0009-Start-ctrl-alt-del.target-irreversibly.patch
] ++ stdenv.lib.optional stdenv.isArm ./libc-bug-accept4-arm.patch; ] ++ stdenv.lib.optional stdenv.isArm ./libc-bug-accept4-arm.patch;
buildInputs = buildInputs =