Bug#533079: asterisk: start-stop-daemon should have --make-pid
Darshaka Pathirana
dpat at syn-net.org
Sun Jun 14 15:08:25 UTC 2009
Package: asterisk
Version: 1:1.4.21.2~dfsg-3
Severity: normal
Tags: patch
Hi!
I am maintaining a local asterisk-config package and had a
problem with my postinst script.
The relevant sniplet looks like this (call it test.postinst):
#!/bin/sh
set -e
.. /usr/share/debconf/confmodule
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
if [ -x "/etc/init.d/asterisk" ]; then
/etc/init.d/asterisk restart
fi
exit 0
While RUNASTSAFE was not set (and therefore defaults to "NO") the script
used to hang after the postinst-process. Setting RUNASTSAFE=yes
(in /etc/default/asterisk) the problem vanished. The script exited normally.
This can be tested with (set RUNASTSAFE to "yes" and "no"):
% sh -x ./test.postinst
Curious what the problem is I found out that "--make-pid" was missing in
the "start"-section without RUNASTSAFE:
--- /etc/init.d/asterisk.orig 2009-06-14 17:01:23.000000000 +0200
+++ /etc/init.d/asterisk 2009-06-14 16:31:44.000000000 +0200
@@ -170,7 +170,7 @@
echo "$DESC is already running. Use restart."
exit 0
fi
- start-stop-daemon --start --group $GROUP --pidfile "$PIDFILE" \
+ start-stop-daemon --start --group $GROUP --make-pidfile --pidfile "$PIDFILE" \
$CHDIR_PARM \
--exec $REALDAEMON -- $PARAMS
After adding the option my postinst-script run fine.
Please note that running "/etc/init.d/asterisk restart" on the command line
caused no problems. So there must be something wrong in combination with debconf.
(But I have no idea what why.)
Thanks for maintaining.
Greetings,
- Darsha
-- System Information:
Debian Release: 5.0.1
APT prefers stable
APT policy: (500, 'stable')
Architecture: i386 (i686)
Kernel: Linux 2.6.26-486-voyage (PREEMPT)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash
More information about the Pkg-voip-maintainers
mailing list