core: make sure initrd-switch-root command survives PID1's killing spree (#4730)

System Internals / systemd - Franck Bui [suse.com] - 24 November 2016 11:52 UTC

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().

acc28e2 core: make sure initrd-switch-root command survives PID1's killing spree (#4730)
src/systemctl/systemctl.c | 10 ++++++++++
units/initrd-switch-root.service.in | 8 +-------
2 files changed, 11 insertions(+), 7 deletions(-)

Upstream: github.com


  • Share