[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

automating debconf



is there any reason why "dpkg-reconfigure -ftext" requires a controlling
tty?

this prevents it from being scripted with ssh and either redirected
stdin or an expect style script.

e.g. a script like the following:

---cut here---
#! /bin/sh

HOST="$1"

ssh $HOST '
PATH="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin"

dpkg-reconfigure -ftext debconf <<__EOF__
t
l
yes
no
__EOF__
'
---cut here---

i've got several remote boxes which need this done to them so that i can
script upgrades for important packages as security updates are released -
e.g. bind last week and ssh now.


the response i get from the remote boxes is:

# ./reconf.sh HOSTNAME.EXAMPLE.COM
sh: /dev/tty: No such device or address
sh: /dev/tty: No such device or address
debconf: failed to initialize Text frontend
debconf: falling back to Dialog frontend
sh: /dev/tty: No such device or address
sh: /dev/tty: No such device or address

i discovered this because my script which upgraded ssh bombed out
because it couldn't do Slang stuff....fair enough, i guess. so now i
want to dpkg-reconfigure debconf so that it uses the text method as it
should be possible to script plain text i/o.

no such luck.



i'm hoping that there's a way around this, and that i'm just doing
something the wrong way...


it seems to me that there should be a new debconf method called "pipe"
which allowed you to set the values like so:

dpkg-reconfigure -fpipe debconf <<__EOF__
debconf/frontend="Text"
debconf/priority="low"
debconf/preconfig="yes"
debconf/showold="no"
__EOF__


a utility to just list the questions would be useful. something a bit
more reliable than setting EDITOR to /bin/cat:

# export EDITOR=/bin/cat
# dpkg-reconfigure -feditor debconf | grep -v "#\|^$"
debconf/frontend="Text"
debconf/priority="low"
debconf/preconfig="yes"
debconf/showold="no"



a pipe method would let me preconfigure everything i needed in a script
before calling apt-get to install the packages. this would be extremely
useful.



craig

--
craig sanders <cas@taz.net.au>

      GnuPG Key: 1024D/CD5626F0 
Key fingerprint: 9674 7EE2 4AC6 F5EF 3C57  52C3 EC32 6810 CD56 26F0



Reply to: