[prev in list] [next in list] [prev in thread] [next in thread] 

List:       systemd-devel
Subject:    Re: [systemd-devel] What is the shutdown sequence with systemd and dracut?
From:       Lennart Poettering <lennart () poettering ! net>
Date:       2022-08-15 9:32:38
Message-ID: YvoStsizBdLz3IPz () gardel-login
[Download RAW message or body]

On Sa, 13.08.22 20:46, Patrick Schleizer (patrick-mailinglists@whonix.org) wrote:

> 2. /lib/systemd/system-shutdown (shutdown.c) runs

Still, this binary is called systemd-shutdown, i.e. with one more 'd'.

> 4. /lib/systemd/system-shutdown performs further cleanup (similar to
> dracut, probably some functionality duplicated with dracut, includes
> kill all remaining processes, unmount remaining file systems)

I am not sure dracut has another killing spree.

> 6. /run/initramfs/shutdown (which is at time of writing only implemented
> in dracut) attempts to kill all remaining processes, unmount remaining
> file systems and calls kernel.

I think the arch initrd also implements this scheme. And IIRC they use
a neat trick, and chainload systemd-shutdown from the initrd, so that
it runs again, and does the actual final shutdown, but that time
without transitioning back into an initrd env. Hence for them PID 1 during
shutdown first transitions from the service manager into
systemd-shutdown, and then from there into into the initrd script, and
then back into systemd-shutdown. I like their approach.

Lennart

--
Lennart Poettering, Berlin
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic