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.
This commit is contained in:
Harald Hoyer 2014-12-08 10:43:54 +01:00
parent 414dc51ca2
commit 25b987fed6
2 changed files with 8 additions and 3 deletions

View File

@ -2,6 +2,10 @@
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)"
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut

View File

@ -8,13 +8,14 @@
[Unit]
Description=Restore /run/initramfs on shutdown
Documentation=man:dracut-shutdown.service(8)
After=local-fs.target
After=local-fs.target boot.mount boot.automount
Wants=local-fs.target
Before=systemd-reboot.service shutdown.target
Conflicts=shutdown.target umount.target
DefaultDependencies=no
ConditionPathExists=/run/initramfs/.need_shutdown
ConditionPathExists=!/run/initramfs/bin/sh
[Service]
RemainAfterExit=yes
Type=oneshot
ExecStart=/bin/true
ExecStop=/usr/lib/dracut/dracut-initramfs-restore