Under certain circumstances, mine where ssh + chroot, if that mean something.
"dialog" program, widely used inside the script, return an error "cannot open
tty-output", like it was a terminal-less connection, the solution for me was to
change all the occurencies where dialog is called in a subshell from:
--- from ---
USER=$(dialog --stdout \
--backtitle "Please choose a username and password for the initial user." \
--inputbox "Username:" 0 0 "admin")
RESULT=$?
--- from ---
to
--- to ---
dialog --output-fd 3 \
--backtitle "Please choose a username and password for the initial user." \
--inputbox "Username:" 0 0 "admin" \
3> "/tmp/${tmpfile}"
RESULT=$?
USER=$(< "/tmp/${tmpfile}" )
--- to ---
may be other are affected, or is this one a misconfiguration issue of this
particular box ?