summaryrefslogtreecommitdiff
path: root/units
diff options
context:
space:
mode:
authorFranck Bui <fbui@suse.com>2016-11-24 18:52:04 +0100
committerLennart Poettering <lennart@poettering.net>2016-11-24 18:52:04 +0100
commitacc28e2e3037d689d6481e4664925cf31d4d087b (patch)
treefd93ecff4ebff8690ec8da76f52020831bfbc5ba /units
parentc495dfb9c38fd1944490f46b8e854f010aeaa238 (diff)
core: make sure initrd-switch-root command survives PID1's killing spree (#4730)
This is a different way to implement the fix proposed by commit a4021390fef27f4136497328f suggested by Lennart Poettering. In this patch we instruct PID1 to not kill "systemctl switch-root" command started by initrd-switch-root service using the "argv[0][0]='@'" trick. See: https://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons/ for more details. We had to backup argv[0] because argv is modified by dispatch_verb().
Diffstat (limited to 'units')
-rw-r--r--units/initrd-switch-root.service.in8
1 files changed, 1 insertions, 7 deletions
diff --git a/units/initrd-switch-root.service.in b/units/initrd-switch-root.service.in
index b89f2348c7..82893dafb1 100644
--- a/units/initrd-switch-root.service.in
+++ b/units/initrd-switch-root.service.in
@@ -17,10 +17,4 @@ AllowIsolate=yes
Type=oneshot
# we have to use "--force" here, otherwise systemd would umount /run
ExecStart=@rootbindir@/systemctl --no-block --force switch-root /sysroot
-
-# Just before switching to the new rootfs, systemd might send us a TERM signal
-# depending on how fast we are to execute the main command and exit. If we get
-# the SIGTERM signal that simply means that we succeed but haven't got enough
-# time to exit properly. Since systemd considers SIGTERM as a failure for
-# short-running process (aka Type=oneshot), instruct it to ignore this case.
-SuccessExitStatus=SIGTERM
+KillMode=none