Skip to content

Commit

Permalink
pdist-bootcheck: Use persistent directory as safeguard
Browse files Browse the repository at this point in the history
The file that is supposed to prevent boot loops in case of pdist
failures is incorrectly created in a per-boot directory and is therefore
ineffective. Move the file fom /var/run to /var/cache.
  • Loading branch information
donald committed May 5, 2025
1 parent e70918b commit d4db813
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pdist/pdist-bootcheck
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ if [ "$need_async_pdist" ]; then
netcat $(distmaster) 237
echo triggered background update
elif [ "$need_pdist_and_reboot" ]; then
if [[ -e /var/run/updatecheck.reboot-triggered ]]; then
if [[ -e /var/cache/updatecheck.reboot-triggered ]]; then
echo "Update and reboot required but prevented due to previous attempt"
rm /var/run/updatecheck.reboot-triggered
rm /var/cache/updatecheck.reboot-triggered
exit 1
fi
if (( $(stat -f -c %f /) * $(stat -f -c %s /) /1024/1024/1024 < 10)); then
echo "Update and reboot required but prevented because of insufficient free disk space (<10G)"
exit 1
fi
echo "Update and reboot required"
touch /var/run/updatecheck.reboot-triggered
touch /var/cache/updatecheck.reboot-triggered
sync /
while true; do sleep 5; echo "System update in progress. Please be patient..."; done &
netcat $(distmaster) 237
Expand Down

0 comments on commit d4db813

Please sign in to comment.