Not possible to run interactive debconf scripts in late-commands
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
subiquity |
New
|
Undecided
|
Unassigned |
Bug Description
With debian installer we were used to run an unattended installation with an interactive debconf-based script to join the server to AD domain. So the whole server setup (except hostname) is automatic and predefined and the only last step requires some input form user.
The script looks something like this:
#!/bin/sh
cat > /tmp/MyInstall.
Template: my-install/username
Type: string
Description: Username that will be used for joining the domain
Template: my-install/password
Type: password
Description: Password that will be used for joining the domain
Template: my-install/title
Type: title
Description: Credentials for joining the domain
Template: my-install/ou
Type: select
Choices: #LIST of OU's
Description: Credentials for joining the domain
!EOF!
debconf-
db_settitle my-install/title
db_input critical my-install/username || true
db_input critical my-install/password || true
db_input critical my-install/ou || true
db_go
db_get my-install/username
admin_user=$RET
db_get my-install/password
admin_password=$RET
db_get my-install/ou
ou=$RET
name="$(hostname -f)"
in-target /bin/bash -c "echo '$admin_password' | kinit $admin_user"
in-target klist
in-target msktutil --create --base $ou --service host --keytab /etc/krb5.keytab --upn host/$name --verbose
=======
With subiquity this is not working and none of the hacks that we tried helped. Joining server to domain after installation is a major inconvenience as you need to log in with local user account, and run those commands manually which can lead to errors.
It would be great to have scripts running in late-commands to have a way to interact with the user installing the server in one way or another.
This has been asked about by someone else here: https:/
Adding a "me too" to this. One specific example of something we've always done in a d-i late_command via preseed is to set a grub password. We do this is a late_command to make sure that the installer has finished installing grub before we attempt to alter the config.
Our package has a templates file that looks like: grub/username
Template: thayer-
Type: string
Description: GRUB Username:
GRUB menu username.
Template: thayer- grub/password
Type: password
Description: GRUB Password:
GRUB menu password.
And then a postinst that does this: debconf/ confmodule
# Source debconf library.
. /usr/share/
# Get the username and password grub/username grub/password
db_get thayer-
USER="${RET}"
db_get thayer-
PASSWORD="${RET}"
With subiquity, we're trying to install this with a late-command like:
curtin in-target --target=/target -- apt-get -y install thayer-grub-efi
However, there's no frontend for debconf, so the user is never prompted: ------- ------- ------ perl5/Debconf/ DbDriver/ Stack.pm line 111. perl5/Debconf/ DbDriver/ Stack.pm line 111.
Setting up thayer-grub-efi (0.1-3) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
Configuring thayer-grub-efi
-------
GRUB menu username.
GRUB Username:
GRUB menu password.
GRUB Password:
Use of uninitialized value $_[1] in join or string at /usr/share/
Use of uninitialized value $_[1] in join or string at /usr/share/