-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff13c8b
commit b7e47ee
Showing
18 changed files
with
410 additions
and
3,526 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,6 @@ | |
/dist | ||
/mkosi.build | ||
/mkosi.egg-info | ||
/mkosi.extra | ||
/mkosi.nspawn | ||
/mkosi.rootpw | ||
/mkosi.conf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash -eux | ||
# SPDX-License-Identifier: LGPL-2.1-or-later | ||
|
||
systemctl --failed --no-legend | tee /failed-services | ||
|
||
# Exit with non-zero EC if the /failed-services file is not empty (we have -e set) | ||
[[ ! -s /failed-services ]] | ||
|
||
: >/testok |
14 changes: 14 additions & 0 deletions
14
mkosi.extra/usr/lib/systemd/system/mkosi-check-and-shutdown.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Oops, something went wrong.