Fixed the dracut-shutdown.service
Make the service a oneshot service, which remains after exit. This ensures, that the ExecStop is executed later on, if a shutdown occurs.master
parent
414dc51ca2
commit
25b987fed6
|
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# do some sanity checks first
|
||||||
|
[ -e /run/initramfs/bin/sh ] && exit 0
|
||||||
|
[ -e /run/initramfs/.need_shutdown ] || exit 0
|
||||||
|
|
||||||
KERNEL_VERSION="$(uname -r)"
|
KERNEL_VERSION="$(uname -r)"
|
||||||
|
|
||||||
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
|
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
|
||||||
|
|
|
||||||
|
|
@ -8,13 +8,14 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Restore /run/initramfs on shutdown
|
Description=Restore /run/initramfs on shutdown
|
||||||
Documentation=man:dracut-shutdown.service(8)
|
Documentation=man:dracut-shutdown.service(8)
|
||||||
After=local-fs.target
|
After=local-fs.target boot.mount boot.automount
|
||||||
Wants=local-fs.target
|
Wants=local-fs.target
|
||||||
Before=systemd-reboot.service shutdown.target
|
Conflicts=shutdown.target umount.target
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
ConditionPathExists=/run/initramfs/.need_shutdown
|
|
||||||
ConditionPathExists=!/run/initramfs/bin/sh
|
ConditionPathExists=!/run/initramfs/bin/sh
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
RemainAfterExit=yes
|
||||||
|
Type=oneshot
|
||||||
ExecStart=/bin/true
|
ExecStart=/bin/true
|
||||||
ExecStop=/usr/lib/dracut/dracut-initramfs-restore
|
ExecStop=/usr/lib/dracut/dracut-initramfs-restore
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue