Goal: Preserve SSH host keys when re-building a Linux host. Handy when you’re in a dev environment.
I’ve had both Spacewalk and RHSat5 running for years here, and one of the very useful snippets has been the keep_ssh_host_keys snippet. Unfortunately, taken as-is from Spacewalk, the installs would hang at the final close of the pre-install section of the kickstart.
The solution (found at https://fedoraproject.org/wiki/Anaconda/Kickstart/es#Chapter_4._Pre-installation_Script) was to make sure that the final while loop that would populate the new SSH directory needs to have stdin, stdout and stderr either closed or redirected from the main bash execution.
done < /dev/null > /tmp/keep_ssh_host_keys.txt 2>&1 &
This has allowed the pre install section to close, yet leave the while loop in the background to complete processing.
This certainly could be a useful technique for other purposes.