summaryrefslogtreecommitdiffstats
path: root/test/mkosi-check-and-shutdown.service
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test/mkosi-check-and-shutdown.service14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/mkosi-check-and-shutdown.service b/test/mkosi-check-and-shutdown.service
new file mode 100644
index 0000000..6539325
--- /dev/null
+++ b/test/mkosi-check-and-shutdown.service
@@ -0,0 +1,14 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Unit]
+Description=Check if any service failed and then shutdown the machine
+After=multi-user.target network-online.target
+Requires=multi-user.target
+Wants=systemd-resolved.service systemd-networkd.service network-online.target
+OnFailure=poweroff.target
+OnFailureJobMode=replace-irreversibly
+
+[Service]
+Type=oneshot
+ExecStartPre=-rm -f /failed-services
+ExecStart=/usr/lib/systemd/mkosi-check-and-shutdown.sh
+ExecStartPost=systemctl poweroff --no-block