1 DRACUT-SHUTDOWN.SERVICE(8)
2 ===========================
9 dracut-shutdown.service - unpack the initramfs to /run/initramfs
13 dracut-shutdown.service
17 This service unpacks the initramfs image to /run/initramfs.
18 systemd pivots into /run/initramfs at shutdown, so the root filesytem
19 can be safely unmounted.
21 The following steps are executed during a shutdown:
23 * systemd switches to the shutdown.target
24 * systemd starts /lib/systemd/system/shutdown.target.wants/dracut-shutdown.service
25 * dracut-shutdown.service executes /usr/lib/dracut/dracut-initramfs-restore which unpacks the initramfs to /run/initramfs
26 * systemd finishes shutdown.target
27 * systemd kills all processes
28 * systemd tries to unmount everything and mounts the remaining read-only
29 * systemd checks, if there is a /run/initramfs/shutdown executable
30 * if yes, it does a pivot_root to /run/initramfs and executes ./shutdown. The old root is then mounted on /oldroot. /usr/lib/dracut/modules.d/99shutdown/shutdown.sh is the shutdown executable.
31 * shutdown will try to umount every /oldroot mount and calls the various shutdown hooks from the dracut modules
33 This ensures, that all devices are disassembled and unmounted cleanly.
35 To debug the shutdown process, you can get a shell in the shutdown procedure
36 by injecting "rd.break=pre-shutdown rd.shell" or "rd.break=shutdown rd.shell".
38 # mkdir -p /run/initramfs/etc/cmdline.d
39 # echo "rd.break=pre-shutdown rd.shell" > /run/initramfs/etc/cmdline.d/debug.conf
40 # touch /run/initramfs/.need_shutdown