summaryrefslogtreecommitdiffstats
path: root/test/mkosi-check-and-shutdown.service
blob: 6539325108cbd5ea598389045b19c88bb82b7902 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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