summaryrefslogtreecommitdiffstats
path: root/mkinitcpio-generate-shutdown-ramfs.service
diff options
context:
space:
mode:
authorThomas Bächler <thomas@archlinux.org>2013-11-19 23:10:28 +0100
committerDave Reisner <dreisner@archlinux.org>2013-11-24 02:57:13 +0100
commit2fa0eb25d47c920c18e7d2498c647a801d836596 (patch)
tree13b6adfc9d791e25fb9d6b1b5cae1dc7150de011 /mkinitcpio-generate-shutdown-ramfs.service
parent88129397a4f4c714195d2a100b851ecf7d0b0e85 (diff)
downloadmkinitcpio-2fa0eb25d47c920c18e7d2498c647a801d836596.tar.gz
mkinitcpio-2fa0eb25d47c920c18e7d2498c647a801d836596.tar.xz
Add mkinitcpio-generate-shutdown-ramfs.service
When enabled, this service generates an "initramfs" that systemd pivots to on shutdown to ensure clean umounting and shutdown of loop and dm devices. The actual work is done by systemd-shutdown.
Diffstat (limited to 'mkinitcpio-generate-shutdown-ramfs.service')
-rw-r--r--mkinitcpio-generate-shutdown-ramfs.service15
1 files changed, 15 insertions, 0 deletions
diff --git a/mkinitcpio-generate-shutdown-ramfs.service b/mkinitcpio-generate-shutdown-ramfs.service
new file mode 100644
index 0000000..36c2508
--- /dev/null
+++ b/mkinitcpio-generate-shutdown-ramfs.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Generate shutdown-ramfs
+DefaultDependencies=no
+Before=shutdown.target
+ConditionFileIsExecutable=!/run/initramfs/shutdown
+
+[Service]
+Type=oneshot
+# /tmp could be umounted at this point
+# use /run as temporary directory
+Environment=TMPDIR=/run
+ExecStart=/usr/bin/mkinitcpio -A sd-shutdown -c /dev/null -d /run/initramfs
+
+[Install]
+WantedBy=shutdown.target