Bug#376514: init.d script stop command does not always work if using safe_asterisk

Pierre Machard pmachard at debian.org
Thu Oct 12 12:35:14 UTC 2006


Hi,

On Mon, Jul 03, 2006 at 01:50:24PM +0200, Alessandro Polverini wrote:
> Package: asterisk
> Version: 1:1.2.9.1.dfsg-1
> Severity: normal
> 
> server:~# /etc/init.d/asterisk stop
> Stopping Asterisk PBX: asteriskstart-stop-daemon: warning: failed to kill 5395: No such process
> 
> Asterisk ended with exit status 0
> .
> server:~#
> server:~# Asterisk shutdown normally.
> 
> ---
> 
> This time asterisk was shot down, but in other cases I didn't have the correct behavior.

The problem here is that the pid recorded is not the good one.

migus at debian:~$ ps aux | grep safe
root      4707  0.0  0.1  2288 1100 ?        S    12:03   0:00 /bin/sh /usr/sbin/safe_asterisk -p -U asterisk

migus at debian:~$ cat /var/run/asterisk/asterisk_safe.pid
4705

The problem is that into /usr/sbin/safe_asterisk launch an other process:

migus at debian:~$ tail -1  /usr/sbin/safe_asterisk
run_asterisk &

The solution is either to rewrite the safe_asterisk (clean) or to record
pid file into the init.d/asterisk file with the help of something like 
$> echo `ps aux | grep safe_asterisk | awk '{print $2}' | head -1` > file.pid


Hope this help. Currently I do not know which solution I will use.

Cheers,
-- 
Pierre Machard





More information about the Pkg-voip-maintainers mailing list