Going nuts over debconf
Hi,
Problem summary: Using debconf and rc.d script hangs package installation
--
I am merging packages `powstatd' and `powstad-crypt' into a single new
`powstatd' package with encryption enabled. I wrote a debconf script
that displays a warning in certain cases when the configuration file must
be edited for the new package to continue working.
Upgrading to the new package works fine if the postinst script does not
start an rc.d process (e.g. because the package conffile doesn't enable
it). Upgrading hangs when the postinst process is started. Here's what
I see with `ps':
dpkg -i powstatd_1.5.1-3_i386.deb
/usr/bin/perl -w /usr/share/debconf/frontend /var/lib/dpkg/info/powstatd.postinst configure 1.5.1-1
[powstatd.postin] <defunct>
/sbin/powstatd
The defunct powstatd.postinst script is:
-------------------------------------------------------------------------
#!/bin/sh
#
# postinst script for the powstatd package
set -e
. /usr/share/debconf/confmodule
case "$1" in
configure)
# Versions prior to 1.5.1-3 used file readable by all, but no longer.
if [ -f /etc/powstatd.conf ]; then
chmod go-rwx /etc/powstatd.conf
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
;;
esac
# Automatically added by dh_installinit
if [ -x "/etc/init.d/powstatd" ]; then
update-rc.d powstatd defaults >/dev/null
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
invoke-rc.d powstatd start || exit 0
else
/etc/init.d/powstatd start || exit 0
fi
fi
# End automatically added section
-------------------------------------------------------------------------
The package installation hangs whether the warning message is displayed
or not.
Here's the debconf file:
--------------------------------------
#!/bin/sh -e
action=$1
version=$2
test -f /etc/powstatd.conf || exit 0
if grep -q "slave" /etc/powstatd.conf || ! grep -q "watch .*tty" /etc/powstatd.conf && ! grep -q "password" /etc/powstatd.conf; then
. /usr/share/debconf/confmodule
db_input high powstatd/cryptpassword || true
db_go || true
fi
exit 0
--------------------------------------
Am I doing something obviously wrong ?
Thanks,
Peter
Reply to: