summaryrefslogtreecommitdiffstats
path: root/debian/mdadm.mdadm-shutdown.service
blob: a949b7cba37d33935a1ee541d7adc1becfc040e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
[Unit]
Description=Prepare mdadm shutdown initramfs
ConditionFileIsExecutable=/usr/bin/dracut
After=local-fs.target boot.mount boot.automount
Wants=local-fs.target
Before=shutdown.target
Conflicts=shutdown.target umount.target
DefaultDependencies=no
Documentation=man://dracut(8)

[Service]
RemainAfterExit=yes
Type=oneshot
ExecStart=/bin/true
ExecStop=/bin/mount -o remount,exec,suid /run
ExecStop=/bin/mkdir -p /run/initramfs
ExecStop=/usr/bin/dracut --no-compress --no-kernel --quiet --force --force-add "shutdown mdraid" --omit "caps" /run/initramfs/shutdown.cpio
ExecStop=/bin/sh -c 'cd /run/initramfs; cpio -id --quiet < shutdown.cpio'
ExecStop=/bin/rm /run/initramfs/shutdown.cpio

[Install]
WantedBy=sysinit.target