dracut.asc: document shutdown procedure

master
Harald Hoyer 2013-01-18 10:13:14 +01:00
parent 0ae480dcbf
commit 1d22c670b0
1 changed files with 21 additions and 1 deletions

View File

@ -79,7 +79,7 @@ udev pulls in modules matching the computer's detected hardware.
initialized and a user-space helper started to paint animations onto the display initialized and a user-space helper started to paint animations onto the display
in lockstep with the boot process. in lockstep with the boot process.


* If the root file system is on NFS, dracut does then: * If the root file system is on NFS, dracut does then:
** Bring up the primary network interface. ** Bring up the primary network interface.
** Invoke a DHCP client, with which it can obtain a DHCP lease. ** Invoke a DHCP client, with which it can obtain a DHCP lease.
** Extract the name of the NFS share and the address of the NFS server from the ** Extract the name of the NFS share and the address of the NFS server from the
@ -120,6 +120,26 @@ final cleanup tasks. On an initramfs, the initial root file system cannot be
rotated away. Instead, it is simply emptied and the final root file system rotated away. Instead, it is simply emptied and the final root file system
mounted over the top. mounted over the top.


== Dracut on shutdown

On a systemd driven system, the dracut initramfs is also used for the shutdown procedure.

The following steps are executed during a shutdown:

* systemd switches to the shutdown.target
* systemd starts /lib/systemd/system/shutdown.target.wants/dracut-shutdown.service
* dracut-shutdown.service executes /usr/lib/dracut/dracut-initramfs-restore
which unpacks the initramfs to /run/initramfs
* systemd finishes shutdown.target
* systemd kills all processes
* systemd tries to unmount everything and mounts the remaining read-only
* systemd checks, if there is a /run/initramfs/shutdown executable
* 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.
* shutdown will try to umount every /oldroot mount and calls the various shutdown hooks from the dracut modules

This ensures, that all devices are disassembled and unmounted cleanly.

= User Manual = User Manual


== Creating an initramfs Image == Creating an initramfs Image