mirror of
https://github.com/dracutdevs/dracut.git
synced 2024-10-26 16:25:20 +03:00
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:
parent
414dc51ca2
commit
25b987fed6
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user