CVSROOT: /cvs Module name: src Changes by: flor...@cvs.openbsd.org 2022/05/05 14:07:23
Modified files: distrib/miniroot: install.sub Log message: Fix watchdog in the installer. We only had one watchdog running that triggered after 30 minutes. If an unattended upgrade (e.g. started by sysupgrade(8)) took longer than this in total, the machine would reboot half way through an upgrade. The intention was that the watchdog would be reset after each set download and after each set installation. But this never worked correctly because the actual upgrade ran in a sub-shell and WDPID was not visible. To fix this we first need to export WDPID to make it visible in the sub-shell. Then reset_watchdog was guarded by $UU && reset_watchdog, but UU wasn't visible either. But we can't export it because we would enter a loop. We can just use the fact that WDPID is not empty to restart the watchdog. Lastly the watchdog process would keep stderr and stdout open. This made the tee(1) hang that is collecting the autoupgrade log that is mailed to root. As a simplification, we don't need to run the watchdog as a co-process, we don't want to communicate with it, we can just run it in the background. Problem reported by stsp With & OK deraadt OK millert