Bug#926390: sysvinit-utils: /lib/init/init-d-script always fails when VERBOSE=no
Marc Lehmann
debian-reportbug at plan9.de
Thu Apr 4 11:44:17 BST 2019
Package: sysvinit-utils
Version: 2.88dsf-59.9
Severity: normal
Dear Maintainer,
I tried to install the snmpd package, but the post-install script always
failed because invoke-rc.d snm,pd restart failed.
Surprisingly, running it interactively always worked.
It turned out the problem was /lib/init/init-d-script's jandling of
VERBOSE, in shoprt, if VERBOSE=no, it always fails.
The reason is that "snmpd restart" falls through to the last case
statement in init-s-script:
restart)
call do_restart
;;
...
exit $? # See https://bugs.debian.org/822753#53
do_restart looks like this:
call do_start_cmd
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
and this always has exit status 1, as do_startr_cmd returns either 0, 1
or 2, and in all cases, [ no != no ] is false, so the exit status becomes
false, and thuis the whole init script exit status becomes false.
The end result is that the snmpd package always failed postinstall and
couldn't be removed either, while it's init-scripot works fine when
running at the shell, because VERBOSE isn't "no".
IF this is a bug in snmpd's init script, could you reassign it to the correct package?
-- System Information:
Debian Release: 9.8
APT prefers stable
APT policy: (990, 'stable'), (500, 'unstable-debug'), (500, 'testing-debug'), (500, 'stable-updates'), (500, 'stable-debug'), (500, 'unstable'), (500, 'testing'), (1, 'experimental-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, x32
Kernel: Linux 4.19.27-041927-generic (SMP w/8 CPU cores)
Locale: LANG=POSIX, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=POSIX (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages sysvinit-utils depends on:
ii init-system-helpers 1.56+nmu1
ii libc6 2.28-8
ii util-linux 2.29.2-1+deb9u1
sysvinit-utils recommends no packages.
sysvinit-utils suggests no packages.
-- no debconf information
More information about the Debian-init-diversity
mailing list