bundles/apt: check for "reboot required" in icinga check only
Some checks failed
kunsi/bundlewrap/pipeline/head There was a failure building this commit

This avoids the need to manually adjust the status file after a reboot of
the server.
This commit is contained in:
Franzi 2022-01-30 11:43:14 +01:00
parent 11969b6064
commit 4cfbdb32d6
Signed by: kunsi
GPG key ID: 12E3D2136B818350
2 changed files with 12 additions and 13 deletions

View file

@ -22,12 +22,16 @@ case "$exitcode" in
exit 1 exit 1
;; ;;
reboot) reboot)
echo "Upgrades require a reboot, but automatic rebooting is disabled"
exit 1
;; ;;
0) 0)
if [[ -f /var/run/reboot-required ]]
then
echo "OK, but updates require a reboot"
exit 1
else
echo "OK" echo "OK"
exit 0 exit 0
fi
;; ;;
*) *)
echo "Last exitcode was $exitcode" echo "Last exitcode was $exitcode"

View file

@ -44,18 +44,13 @@ then
exit 1 exit 1
fi fi
if [[ -f /var/run/reboot-required ]] if [[ -f /var/run/reboot-required ]] && [[ "$auto_reboot_enabled" == "True" ]]
then then
if [[ "$auto_reboot_enabled" == "False" ]]
then
echo "reboot" > "$statusfile"
else
if [[ -n "$reboot_mail_to" ]] if [[ -n "$reboot_mail_to" ]]
then then
date | mail -s "SYSREBOOTNOW $nodename" "$reboot_mail_to" date | mail -s "SYSREBOOTNOW $nodename" "$reboot_mail_to"
fi fi
systemctl reboot systemctl reboot
fi fi
fi
echo "upgrade-and-reboot for node $nodename is DONE" echo "upgrade-and-reboot for node $nodename is DONE"