root@snmp-agent:~# journalctl
-- Logs begin at Mon 2017-08-14 13:21:17 IST, end at Mon 2017-08-14 14:20:21 IST. --
Aug 14 13:21:17 snmp-agent systemd-journald[232]: Runtime journal (/run/log/journal/) is 1.2M, max 9.9M, 8.6M free.
Aug 14 13:21:17 snmp-agent kernel: Linux version 4.10.0-32-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubunt
Aug 14 13:21:17 snmp-agent kernel: Command line: BOOT_IMAGE=/boot/vmlinuz-4.10.0-32-generic root=UUID=97f8568c-9826-450d-837f-4d91b31
Aug 14 13:21:17 snmp-agent kernel: KERNEL supported cpus:
Aug 14 13:21:17 snmp-agent kernel: Intel GenuineIntel
Aug 14 13:21:17 snmp-agent kernel: AMD AuthenticAMD
Aug 14 13:21:17 snmp-agent kernel: Centaur CentaurHauls
Aug 14 13:21:17 snmp-agent kernel: x86/fpu: Legacy x87 FPU detected.
Aug 14 13:21:17 snmp-agent kernel: e820: BIOS-provided physical RAM map:
Aug 14 13:21:17 snmp-agent kernel: BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
Aug 14 13:21:17 snmp-agent kernel: BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
Aug 14 13:21:17 snmp-agent kernel: BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
Aug 14 13:21:17 snmp-agent kernel: BIOS-e820: [mem 0x0000000000100000-0x000000003ffeffff] usable
Aug 14 13:21:17 snmp-agent kernel: BIOS-e820: [mem 0x000000003fff0000-0x000000003fffffff] ACPI data
Aug 14 13:21:17 snmp-agent kernel: BIOS-e820: [mem 0x00000000fec00000-0x00000000fec00fff] reserved
Aug 14 13:21:17 snmp-agent kernel: BIOS-e820: [mem 0x00000000fee00000-0x00000000fee00fff] reserved
Aug 14 13:21:17 snmp-agent kernel: BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved
Aug 14 13:21:17 snmp-agent kernel: NX (Execute Disable) protection: active
Aug 14 13:21:17 snmp-agent kernel: SMBIOS 2.5 present.
Aug 14 13:21:17 snmp-agent kernel: DMI: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
Aug 14 13:21:17 snmp-agent kernel: Hypervisor detected: KVM
Aug 14 13:21:17 snmp-agent kernel: e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
Aug 14 13:21:17 snmp-agent kernel: e820: remove [mem 0x000a0000-0x000fffff] usable
Aug 14 13:21:17 snmp-agent kernel: e820: last_pfn = 0x3fff0 max_arch_pfn = 0x400000000
Aug 14 13:21:17 snmp-agent kernel: MTRR default type: uncachable
Aug 14 13:21:17 snmp-agent kernel: MTRR variable ranges disabled:
Aug 14 13:21:17 snmp-agent kernel: MTRR: Disabled
Aug 14 13:21:17 snmp-agent kernel: x86/PAT: MTRRs disabled, skipping PAT initialization too.
Aug 14 13:21:17 snmp-agent kernel: x86/PAT: Configuration [0-7]: WB WT UC- UC WB WT UC- UC
Aug 14 13:21:17 snmp-agent kernel: CPU MTRRs all blank - virtualized system.
Aug 14 13:21:17 snmp-agent kernel: found SMP MP-table at [mem 0x0009fff0-0x0009ffff] mapped at [ffffa04e4009fff0]
Aug 14 13:21:17 snmp-agent kernel: Scanning 1 areas for low memory corruption
Aug 14 13:21:17 snmp-agent kernel: Base memory trampoline at [ffffa04e40099000] 99000 size 24576
Aug 14 13:21:17 snmp-agent kernel: BRK [0x0ec28000, 0x0ec28fff] PGTABLE
Aug 14 13:21:17 snmp-agent kernel: BRK [0x0ec29000, 0x0ec29fff] PGTABLE
Aug 14 13:21:17 snmp-agent kernel: BRK [0x0ec2a000, 0x0ec2afff] PGTABLE
Aug 14 13:21:17 snmp-agent kernel: BRK [0x0ec2b000, 0x0ec2bfff] PGTABLE
ProblemType: Package
DistroRelease: Ubuntu 16.04
Package: snmpd 5.7.3+dfsg-1ubuntu4
ProcVersionSignature: Ubuntu 4.10.0-32.36~16.04.1-generic 4.10.17
Uname: Linux 4.10.0-32-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.10
AptOrdering:
snmpd: Install
snmpd: Configure
NULL: ConfigurePending
Architecture: amd64
Date: Mon Aug 14 14:19:21 2017
DuplicateSignature:
package:snmpd:5.7.3+dfsg-1ubuntu4
Setting up snmpd (5.7.3+dfsg-1ubuntu4) ...
adduser: The user `snmp' already exists. Exiting.
dpkg: error processing package snmpd (--configure):
subprocess installed post-installation script returned error exit status 1
ErrorMessage: subprocess installed post-installation script returned error exit status 1
InstallationDate: Installed on 2017-08-14 (0 days ago)
InstallationMedia: Ubuntu 16.04.2 LTS "Xenial Xerus" - Release amd64 (20170215.2)
RelatedPackageVersions:
dpkg 1.18.4ubuntu1.2
apt 1.2.24
SourcePackage: net-snmp
Title: package snmpd 5.7.3+dfsg-1ubuntu4 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1
UpgradeStatus: No upgrade log present (probably fresh install)
The postinst script has guards against adding the user if it exists already:
if [ ! `getent passwd snmp >/dev/null` ]; then
if [ ! `getent group snmp >/dev/null` ]; then
--shell /usr/sbin/nologin snmp
--shell /usr/sbin/nologin snmp
# no snmp user & group
adduser --quiet --system --group --home $SNMPDIR \
else
# no snmp user, but snmp group exists
adduser --quiet --system --ingroup snmp --home $SNMPDIR \
fi
elif [ ! `getent group snmp >/dev/null` ]; then
# snmp user exists but no snmp group
addgroup --quiet --system snmp
# if user is local system user (not LDAP or so), then exec usermod /bugs.debian. org/cgi- bin/bugreport. cgi?bug= 482041# 25
# see https:/
if [ ! `getent passwd snmp | cut -d':' -f3` -ge 1000 ]; then
mkdir -p $SNMPDIR || true
usermod -d $SNMPDIR -m -g snmp -s /usr/sbin/nologin snmp
fi
fi
It specifically uses getent to check for an existing user or group, in case it's in a remote (networked) database like ldap.
That being said, looks like it's not working: snmpd-1710579: ~# ./postinst.sh /var/lib/ snmp
root@xenial-
+ set -e
+ SNMPDIR=
+ getent passwd snmp
+ [ ! ]
+ getent group snmp
+ [ ! ]
+ echo no snmp user and group
no snmp user and group
+ adduser --quiet --system --group --home /var/lib/snmp --shell /usr/sbin/nologin snmp
That adduser call doesn't fail, though: snmpd-1710579: ~# adduser --quiet --system --group --home /var/lib/snmp --shell /usr/sbin/nologin snmp snmpd-1710579: ~# echo $?
root@xenial-
root@xenial-
0
Removing --quiet: snmpd-1710579: ~# adduser --system --group --home /var/lib/snmp --shell /usr/sbin/nologin snmp snmpd-1710579: ~# echo $?
root@xenial-
Warning: The home dir /var/lib/snmp you specified already exists.
The system user `snmp' already exists. Exiting.
root@xenial-
0
This warrants further debugging.