[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:       Andrei Borzenkov <arvidjaar () gmail ! com>
Date:       2022-08-08 13:17:40
Message-ID: 86e001c0-cb1b-31b7-a0e6-c1cb3e5ca2f4 () gmail ! com
[Download RAW message or body]

On 08.08.2022 15:24, Patrick Schleizer wrote:
> Hi!
> 
> This is what I think but please correct me if I am wrong.
> 
> 1. systemd runs systemd units for systemd shutdown.target
> 
> 2. /lib/systemd/system-shutdown (shutdown.c) runs
> 
> 3. /lib/systemd/system-shutdown executes /run/initramfs/shutdown (which
> is dracut)
> 
> 4. dracut shutdown.sh performs various cleanup tasks (such as kill all
> remaining processes and unmount root disk)
> 
> 5. /lib/systemd/system-shutdown runs scripts in the
> /usr/lib/systemd/system-shutdown/ folder
> 
> 6. /lib/systemd/system-shutdown performs further cleanup (similar to
> dracut, probably some functionality duplicated with dracut, includes
> kill all remaining processes, unmount the root risk) and eventually
> halt/reboot/poweroff/kexec.
> 

No. The sequence is 1, 2, 5, 6 (up to halt/reboot/poweroff/kexec). Then
if /run/initramfs/shutdown is present, systemd-shutdown executes it.
What happens later is completely outside of systemd scope, there is no
return. If this fails or /run/initramfs/shutdown is not present,
systemd-shutdown calls kernel to actually perform
halt/reboot/poweroff/kexec.

Dracut shutdown script attempts to unmount remaining filesystems and
calls kernel.
[prev in list] [next in list] [prev in thread] [next in thread] 

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