A unintended side effect was introduced in 21ef304, which caused the auto-installer to reboot on error, even though the answer file option `general.reboot_on_error` has been set to `false`.
When an error signal is received inside `unconfigured.sh` (after the trap statement `trap 'err_reboot' ERR`), it causes any failing command to execute the `err_reboot` function and therefore dropping the user in the debug shell. One exception, as described under `trap` in bash(1), is for a command being part of the test in an if statement. Therefore, simply simulate a trap by calling `err_reboot` directly. Fixes: 21ef304 ("unconfigured.sh: run proxmox-post-hook after successful auto-install") Signed-off-by: Daniel Kral <d.k...@proxmox.com> --- I've tested this by booting into debug mode with a auto-installer prepared ISO that has an invalid configuration (in this case, the first-boot executable is not available in FromIso mode), patching the `/usr/sbin/unconfigured.sh` script, forcing `start_auto_installer=1` and skipping any statements in `unconfigured.sh`, which have already been run to be in the debug shell (mounting procfs, sysfs, dhcp, ...). When running `unconfigured.sh`, I have been dropped in another debug shell with the output: ```sh root@proxmox:/# unconfigured.sh Caching device info from udev Fetching answers for automatic installation Starting automatic installation INFO: Starting auto installer ERROR: Installer setup error: Failed to retrieve setup info: No such file or directory (os error 2) Installation aborted - unable to continue (type exit or CTRL-D to reboot) root@proxmox:/$ _ ``` unconfigured.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/unconfigured.sh b/unconfigured.sh index 070cf33..f9cc9de 100755 --- a/unconfigured.sh +++ b/unconfigured.sh @@ -260,6 +260,9 @@ elif [ $start_auto_installer -ne 0 ]; then echo "waiting 30s to allow gathering the error before reboot." sleep 30 fi + else + # simulate a trap to `err_reboot` if the auto-installer fails + err_reboot fi else echo "Starting the installer GUI - see tty2 (CTRL+ALT+F2) for any errors..." -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel