[Pkg-net-snmp-devel] Bug#626312: snmpd: fails to install due to wrong debconf usage

Marc Dequènes (Duck) duck at duckcorp.org
Tue May 10 21:07:22 UTC 2011


Package: snmpd
Version: 5.4.3~dfsg-2.2
Severity: important
Tags: patch


Coin,

As you can see in the file attached, unscd is quite verbose when  
invalidating its cache. Nevertheless, this is not a bug, and should  
not cause debconf breakage and snmpd upgrade failure.

debconf uses some black magic to redirect stdout and probably other  
things, which result in the script to be reexecuted (look at the log).  
It is then necessary to include confmodule at the very beginning of  
the script, as stated by debconf-devel(7):
   For  shell programming, there is the /usr/share/debconf/confmodule  
library, which you can source at the top of a shell script, […]
and:
   * Always  source  /usr/share/debconf/confmodule  at  the  top  of   
your  postinst, even if you won't be running any db_* commands in it.   
This is required to make sure the config script gets a chance to run  
(see HACKS for details).
and, in the 'HACKS' section:
        A related hack is getting debconf running when a config  
script, postinst, or other program that uses it starts up. After all,  
they expect to be able to talk to debconf right away. The way this is  
accomplished for now  is  that when  such  a script loads a debconf  
library (like /usr/share/debconf/confmodule), and debconf is not  
already running, it is started up, and a new copy of the script is  
re-execed. The only noticeable result is that you need to put the line  
that loads a debconf library at the very top of the script, or weird  
things will happen. We hope to address this later by changing how  
debconf is invoked, and turning it into something more like a   
transient  daemon.


Moving the confmodule inclusion up fixes the bug, so please do.

Regards.

-- 
Marc Dequènes (Duck)
-------------- next part --------------

# apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages have been kept back:
  awesome cpp dict g++ gcc guile-1.8-libs irssi ldap-utils libapt-pkg-perl libcairo-perl libdatetime-perl libdigest-sha1-perl libfile-libmagic-perl libfilesys-df-perl libglib-perl libgtk2-perl libhtml-parser-perl libio-pty-perl
  libldap-2.4-2 libldap2-dev liblist-moreutils-perl liblocale-gettext-perl libmouse-perl libnet-dbus-perl libnet-dns-perl libnet-ssleay-perl libpango-perl libparams-validate-perl libpcsc-perl libpurple0 libsnmp15 libsocket6-perl
  libsub-name-perl libsvn-perl libterm-readkey-perl libterm-size-perl libtext-charwidth-perl libtext-iconv-perl libthunarx-2-0 libuuid-perl libwww-curl-perl libxcb-image0 libxml-libxml-perl libxml-parser-perl perl perl-base perl-modules
  pidgin rubygems1.8 slapd thunar vim vim-common vim-nox
0 upgraded, 0 newly installed, 0 to remove and 54 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? 
Setting up snmpd (5.4.3~dfsg-2.2) ...
+ set -e
+ '[' xconfigure = xconfigure ']'
++ getent group snmp
+ '[' '!' ']'
+ deluser --quiet --system snmp
sent invalidate(passwd) request, exiting
sent invalidate(group) request, exiting
sent invalidate(passwd) request, exiting
sent invalidate(group) request, exiting
sent invalidate(passwd) request, exiting
sent invalidate(group) request, exiting
sent invalidate(passwd) request, exiting
sent invalidate(group) request, exiting
+ adduser --quiet --system --group --no-create-home --home /var/lib/snmp snmp
sent invalidate(passwd) request, exiting
sent invalidate(group) request, exiting
sent invalidate(passwd) request, exiting
sent invalidate(group) request, exiting
sent invalidate(group) request, exiting
sent invalidate(group) request, exiting
sent invalidate(passwd) request, exiting
sent invalidate(group) request, exiting
sent invalidate(passwd) request, exiting
sent invalidate(group) request, exiting
sent invalidate(passwd) request, exiting
sent invalidate(group) request, exiting
sent invalidate(passwd) request, exiting
sent invalidate(group) request, exiting
sent invalidate(passwd) request, exiting
sent invalidate(group) request, exiting
sent invalidate(passwd) request, exiting
sent invalidate(group) request, exiting
+ chown -R snmp:snmp /var/lib/snmp
+ . /usr/share/debconf/confmodule
++ '[' '!' '' ']'
++ PERL_DL_NONLAZY=1
++ export PERL_DL_NONLAZY
++ '[' '' ']'
++ exec /usr/share/debconf/frontend /var/lib/dpkg/info/snmpd.postinst configure 5.4.3~dfsg-2
+ set -e
+ '[' xconfigure = xconfigure ']'
++ getent group snmp
+ '[' '!' ']'
+ deluser --quiet --system snmp
+ adduser --quiet --system --group --no-create-home --home /var/lib/snmp snmp
+ chown -R snmp:snmp /var/lib/snmp
+ . /usr/share/debconf/confmodule
++ '[' '!' 1 ']'
++ '[' -z '' ']'
++ exec
++ '[' '' ']'
++ exec
++ DEBCONF_REDIR=1
++ export DEBCONF_REDIR
+ db_version 2.0
+ _db_cmd 'VERSION 2.0'
+ IFS=' '
+ printf '%s\n' 'VERSION 2.0'
+ IFS='
'
+ read -r _db_internal_line
+ RET='20 Unsupported command "sent" (full line was "sent invalidate(passwd) request, exiting") received from confmodule.'
+ case ${_db_internal_line%%[ 	]*} in
+ return 20
dpkg: error processing snmpd (--configure):
 subprocess installed post-installation script returned error exit status 20
configured to not write apport reports
                                      Errors were encountered while processing:
 snmpd
E: Sub-process /usr/bin/dpkg returned an error code (1)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: PGP Digital Signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-net-snmp-devel/attachments/20110510/3519f6a5/attachment-0001.pgp>


More information about the Pkg-net-snmp-devel mailing list