Skip to content

pdist-bootcheck: Don't loop when system disk is full #362

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pdist/pdist-bootcheck
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,15 @@ elif [ "$need_pdist_and_reboot" ]; then
rm /var/run/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
sync /
while true; do sleep 5; echo "System update in progress. Please be patient..."; done &
netcat $(distmaster) 237
mxgrub default
touch /var/run/updatecheck.reboot-triggered
systemctl start reboot.target --job-mode=replace-irreversibly
fi