| 1 | [Unit] |
| 2 | Description=Prepare mdadm shutdown initramfs |
| 3 | ConditionFileIsExecutable=/usr/bin/dracut |
| 4 | After=local-fs.target boot.mount boot.automount |
| 5 | Wants=local-fs.target |
| 6 | Before=shutdown.target |
| 7 | Conflicts=shutdown.target umount.target |
| 8 | DefaultDependencies=no |
| 9 | Documentation=man://dracut(8) |
| 10 | |
| 11 | [Service] |
| 12 | RemainAfterExit=yes |
| 13 | Type=oneshot |
| 14 | ExecStart=/bin/true |
| 15 | ExecStop=/bin/mount -o remount,exec,suid /run |
| 16 | ExecStop=/bin/mkdir -p /run/initramfs |
| 17 | ExecStop=/usr/bin/dracut --no-compress --no-kernel --quiet --force --force-add "shutdown mdraid" --omit "caps" /run/initramfs/shutdown.cpio |
| 18 | ExecStop=/bin/sh -c 'cd /run/initramfs; cpio -id --quiet < shutdown.cpio' |
| 19 | ExecStop=/bin/rm /run/initramfs/shutdown.cpio |
| 20 | |
| 21 | [Install] |
| 22 | WantedBy=sysinit.target |