-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from LorbusChris/devel
Update to v0.9
- Loading branch information
Showing
11 changed files
with
78 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Name: greenboot | ||
Version: 0.8 | ||
Version: 0.9 | ||
Release: 1%{?dist} | ||
Summary: Generic Health Check Framework for systemd | ||
License: LGPLv2+ | ||
|
@@ -67,16 +67,15 @@ Requires: %{name} = %{version}-%{release} | |
%build | ||
|
||
%install | ||
mkdir -p %{buildroot}%{_exec_prefix}/lib/motd.d/ | ||
mkdir -p %{buildroot}%{_libexecdir}/%{name} | ||
mkdir -p %{buildroot}%{_sysconfdir}/%{name}/check/required.d | ||
mkdir %{buildroot}%{_sysconfdir}/%{name}/check/wanted.d | ||
mkdir %{buildroot}%{_sysconfdir}/%{name}/green.d | ||
mkdir %{buildroot}%{_sysconfdir}/%{name}/red.d | ||
mkdir -p %{buildroot}%{_unitdir} | ||
install -DpZm 0755 usr/libexec/greenboot/greenboot %{buildroot}%{_libexecdir}/%{name}/%{name} | ||
install -DpZm 0755 usr/libexec/greenboot/greenboot-grub2-set-counter %{buildroot}%{_libexecdir}/%{name}/greenboot-grub2-set-counter | ||
install -DpZm 0755 usr/libexec/greenboot/greenboot-rpm-ostree-grub2-check-fallback %{buildroot}%{_libexecdir}/%{name}/greenboot-rpm-ostree-grub2-check-fallback | ||
install -DpZm 0755 usr/libexec/greenboot/greenboot-status %{buildroot}%{_libexecdir}/%{name}/greenboot-status | ||
install -DpZm 0755 usr/libexec/greenboot/redboot-auto-reboot-check %{buildroot}%{_libexecdir}/%{name}/redboot-auto-reboot-check | ||
mkdir -p %{buildroot}%{_tmpfilesdir} | ||
install -DpZm 0755 usr/libexec/greenboot/* %{buildroot}%{_libexecdir}/%{name} | ||
install -DpZm 0644 usr/lib/motd.d/boot-status %{buildroot}%{_exec_prefix}/lib/motd.d/boot-status | ||
install -DpZm 0644 usr/lib/systemd/system/* %{buildroot}%{_unitdir} | ||
install -DpZm 0644 usr/lib/tmpfiles.d/greenboot-status-motd.conf %{buildroot}%{_tmpfilesdir}/greenboot-status-motd.conf | ||
|
@@ -86,6 +85,7 @@ install -DpZm 0755 etc/greenboot/check/wanted.d/* %{buildroot}%{_sysconfdir}/%{n | |
%post | ||
%systemd_post greenboot-healthcheck.service | ||
%systemd_post greenboot.service | ||
%systemd_post greenboot.target | ||
%systemd_post redboot.service | ||
%systemd_post redboot.target | ||
|
||
|
@@ -121,6 +121,7 @@ install -DpZm 0755 etc/greenboot/check/wanted.d/* %{buildroot}%{_sysconfdir}/%{n | |
%postun | ||
%systemd_postun greenboot-healthcheck.service | ||
%systemd_postun greenboot.service | ||
%systemd_postun greenboot.target | ||
%systemd_postun redboot.service | ||
%systemd_postun redboot.target | ||
|
||
|
@@ -141,6 +142,7 @@ install -DpZm 0755 etc/greenboot/check/wanted.d/* %{buildroot}%{_sysconfdir}/%{n | |
%{_libexecdir}/%{name}/%{name} | ||
%{_unitdir}/greenboot-healthcheck.service | ||
%{_unitdir}/greenboot.service | ||
%{_unitdir}/greenboot.target | ||
%{_unitdir}/redboot.service | ||
%{_unitdir}/redboot.target | ||
%dir %{_sysconfdir}/%{name} | ||
|
@@ -168,10 +170,13 @@ install -DpZm 0755 etc/greenboot/check/wanted.d/* %{buildroot}%{_sysconfdir}/%{n | |
%{_unitdir}/greenboot-grub2-set-counter.service | ||
|
||
%files reboot | ||
%{_libexecdir}/%{name}/redboot-auto-reboot-check | ||
%{_libexecdir}/%{name}/redboot-auto-reboot | ||
%{_unitdir}/redboot-auto-reboot.service | ||
|
||
%changelog | ||
* Fri Apr 03 2020 Christian Glombek <[email protected]> - 0.9-1 | ||
- Update to v0.9 | ||
|
||
* Wed Feb 05 2020 Christian Glombek <[email protected]> - 0.8-1 | ||
- Update to v0.8 | ||
- Add guard against bootlooping in redboot-auto-reboot.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
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,18 @@ | ||
# SPDX-License-Identifier: LGPL-2.1+ | ||
# | ||
# This file is part of greenboot. | ||
# | ||
# greenboot is free software; you can redistribute it and/or modify it | ||
# under the terms of the GNU Lesser General Public License as published by | ||
# the Free Software Foundation; either version 2.1 of the License, or | ||
# (at your option) any later version. | ||
|
||
[Unit] | ||
Description=greenboot Successful Boot Target | ||
Requires=boot-complete.target | ||
After=boot-complete.target | ||
OnFailure=redboot.target | ||
OnFailureJobMode=fail | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
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 |
---|---|---|
|
@@ -10,3 +10,4 @@ | |
[Unit] | ||
Description=Generic red boot target | ||
Conflicts=boot-complete.target | ||
Conflicts=greenboot.target |
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
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,22 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
bootloader_entries=(/boot/loader/entries/*) | ||
bootloader_entry_count=${#bootloader_entries[@]} | ||
|
||
# If boot_counter is unset, do nothing | ||
if ! grub2-editenv list | grep -q "^boot_counter="; then | ||
echo "<0>SYSTEM is UNHEALTHY, but boot_counter is unset in grubenv. Manual intervention necessary." | ||
exit 1 | ||
# In case we've booted into our fallback deployment and still don't reach boot-complete.target, do nothing. | ||
elif grub2-editenv list | grep -q "^boot_counter=-1$"; then | ||
echo "<0>FALLBACK BOOT DETECTED but SYSTEM is still UNHEALTHY. Manual intervention necessary." | ||
exit 2 | ||
# If we have only one (or less) bootloader entries, don't reboot | ||
elif [ "$bootloader_entry_count" -le 1 ]; then | ||
echo "<0>SYSTEM is UNHEALTHY, but bootlader entry count is $bootloader_entry_count. Manual intervention necessary." | ||
exit 3 | ||
fi | ||
|
||
echo "<1>SYSTEM is UNHEALTHY. Rebooting..." | ||
reboot |
This file was deleted.
Oops, something went wrong.