Comment 3 for bug 682662

Revision history for this message
Trent Lloyd (lathiat) wrote :

Here is the workaround I came up with. Rather than try preseed, we can simply answer the questions at the time they are asked using debconf.

The EDITOR frontend essentially dumps the debconf array into a file, reads it back and uses the results to modify the debconf array.
So rather than even bother with the output it created for us, I just pass in the values I know/want to set - the rest will use defaults.
/root/test.sh would obviously be replaced by something a little more robust but it's good to illustrate the point.
Saves me writing a new Frontend, can re use an existing one.

root@gaz4:~# grep ldap /etc/pam.d/common-auth
root@gaz4:~# cat test.sh
#!/bin/sh
cat > $1 <<EOF
libpam-runtime/profiles="Unix authentication, LDAP Authentication"
EOF
root@gaz4:~# EDITOR=/root/test.sh DEBIAN_FRONTEND=editor pam-auth-update
root@gaz4:~# grep ldap /etc/pam.d/common-auth
auth [success=1 default=ignore] pam_ldap.so use_first_pass
root@gaz4:~#