[Pkg-net-snmp-devel] Bug#626312: Correct solution

Lesley Longhurst Lesley.Longhurst at opus.co.nz
Wed Apr 4 01:07:14 UTC 2012

The correct solution, as stated by the person who logged
the bug,  is to modify the postinst to the version below,
by moving the ". /usr/share/debconf/confmodule" line to
the start of the script.

To anyone who is trying unsuccessfully to install snmp:
the way I got it to work was:
1) Edit /var/lib/dpkg/info/snmpd.postinst, as below
2) Run "aptitude reinstall snmpd"

# ----<  cut here snmpd.postinst>-----
#! /bin/sh

set -e

. /usr/share/debconf/confmodule
db_version 2.0

if [ "x$1" = xconfigure ]; then
         if [ ! `getent group snmp>/dev/null` ]; then
                  deluser --quiet --system snmp
         adduser --quiet --system --group --no-create-home --home /var/lib/snmp snmp
         chown -R snmp:snmp /var/lib/snmp

# Automatically added by dh_installinit
if [ -x "/etc/init.d/snmpd" ]; then
         update-rc.d snmpd defaults>/dev/null
         if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
                 invoke-rc.d snmpd start || exit $?
                 /etc/init.d/snmpd start || exit $?
# End automatically added section

exit 0
# ----<  cut here (end)>-----

Lesley Longhurst (previously Walker)
Linux Systems Administrator
Opus International Consultants Ltd
Email lesley.longhurst at opus.co.nz
Tel +64 4 471 7002, Fax +64 4 473 3017
Level 9  Majestic Centre, 100 Willis Street, PO Box 12 343
Wellington, New Zealand

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