]> git.ipfire.org Git - thirdparty/systemd.git/commit
core: make sure initrd-switch-root command survives PID1's killing spree (#4730)
authorFranck Bui <fbui@suse.com>
Thu, 24 Nov 2016 17:52:04 +0000 (18:52 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 24 Nov 2016 17:52:04 +0000 (18:52 +0100)
commitacc28e2e3037d689d6481e4664925cf31d4d087b
treefd93ecff4ebff8690ec8da76f52020831bfbc5ba
parentc495dfb9c38fd1944490f46b8e854f010aeaa238
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().
src/systemctl/systemctl.c
units/initrd-switch-root.service.in