Bug#786963: asterisk: running /etc/init.d/asterisk start after a crash, or after issuing a stop via asterisk console doesn't start asterisk
Tzafrir Cohen
tzafrir.cohen at xorcom.com
Sun Nov 8 03:52:32 UTC 2015
tag 786962 +moreinfo
thanks
Hi,
On Wed, May 27, 2015 at 10:35:33AM +0200, Simone Ricci wrote:
> Package: asterisk
> Version: 1:11.13.1~dfsg-2+b1
> Severity: important
>
> Dear Maintainer,
>
> trying to start asterisk via /etc/init.d/asterisk start, or by issuing a systemctl start asterisk fails (nothing happens) if machine is recovering from a crash, asterisk itself has crashed or stopped via its console. That's probably related to systemd seeing it running even if it's not.
>
> How to reproduce:
> * Start asterisk normally
> * Stop it via its console (eg. asterisk -rx 'core stop now')
> * Try to start it again, either via /etc/init.d/asterisk start or systemctl start asterisk
> * Nothing Happens and systemctl reports the software as active, for example:
>
> root at softswitch-02:~# systemctl status asterisk
> ● asterisk.service - LSB: Asterisk PBX
> Loaded: loaded (/etc/init.d/asterisk)
> Active: active (exited) since Thu 2015-05-14 00:42:53 CEST; 1 weeks 6 days ago
> Process: 521 ExecStart=/etc/init.d/asterisk start (code=exited, status=0/SUCCESS)
>
That's "exited". Not "running".
> * Notably, when asterisk is effectively running, the output is a bit dissimilar (systemd shows relevant processes):
>
> root at softswitch-02:~# systemctl status asterisk
> ● asterisk.service - LSB: Asterisk PBX
> Loaded: loaded (/etc/init.d/asterisk)
> Active: active (running) since Wed 2015-05-27 10:31:52 CEST; 17s ago
> Process: 5759 ExecStop=/etc/init.d/asterisk stop (code=exited, status=0/SUCCESS)
> Process: 5769 ExecStart=/etc/init.d/asterisk start (code=exited, status=0/SUCCESS)
> CGroup: /system.slice/asterisk.service
> ├─5775 /usr/sbin/asterisk -p -U asterisk
> └─5776 astcanary /var/run/asterisk/alt.asterisk.canary.tweet.tweet.tweet 5775
This is not what I get here:
root at pungenday:/home/tzafrir/VM/root# systemctl status asterisk
● asterisk.service - Asterisk PBX
Loaded: loaded (/lib/systemd/system/asterisk.service; enabled; vendor preset: enabled)
Active: active (running) since ד' 2015-11-04 17:37:22 IST; 3 days ago
Docs: man:asterisk(8)
Main PID: 19703 (asterisk)
CGroup: /system.slice/asterisk.service
└─19703 /usr/sbin/asterisk -g -f -U asterisk
נוב 08 05:46:17 pungenday asterisk[19703]: [Nov 8 05:46:17] NOTICE[19757...)
נוב 08 05:46:37 pungenday asterisk[19703]: [Nov 8 05:46:37] ERROR[19757]...e
נוב 08 05:46:37 pungenday asterisk[19703]: [Nov 8 05:46:37] WARNING[1975...'
נוב 08 05:46:37 pungenday asterisk[19703]: [Nov 8 05:46:37] NOTICE[19757...)
נוב 08 05:46:57 pungenday asterisk[19703]: [Nov 8 05:46:57] ERROR[19757]...e
נוב 08 05:46:57 pungenday asterisk[19703]: [Nov 8 05:46:57] WARNING[1975...'
נוב 08 05:46:57 pungenday asterisk[19703]: [Nov 8 05:46:57] NOTICE[19757...)
נוב 08 05:47:17 pungenday asterisk[19703]: [Nov 8 05:47:17] ERROR[19757]...e
נוב 08 05:47:17 pungenday asterisk[19703]: [Nov 8 05:47:17] WARNING[1975...'
נוב 08 05:47:17 pungenday asterisk[19703]: [Nov 8 05:47:17] NOTICE[19757...)
Hint: Some lines were ellipsized, use -l to show in full.
root at pungenday:/home/tzafrir/VM/root# rasterisk -x 'core stop now'
root at pungenday:/home/tzafrir/VM/root# systemctl status asterisk
● asterisk.service - Asterisk PBX
Loaded: loaded (/lib/systemd/system/asterisk.service; enabled; vendor preset: enabled)
Active: active (running) since א' 2015-11-08 05:47:35 IST; 2s ago
Docs: man:asterisk(8)
Main PID: 9357 (asterisk)
CGroup: /system.slice/asterisk.service
└─9357 /usr/sbin/asterisk -g -f -U asterisk
נוב 08 05:47:37 pungenday asterisk[9357]: [Nov 8 05:47:37] WARNING[9357]...f
נוב 08 05:47:37 pungenday asterisk[9357]: [Nov 8 05:47:37] WARNING[9357]...p
נוב 08 05:47:37 pungenday asterisk[9357]: [Nov 8 05:47:37] WARNING[9357]...n
נוב 08 05:47:37 pungenday asterisk[9357]: [Nov 8 05:47:37] WARNING[9357]...r
נוב 08 05:47:37 pungenday asterisk[9357]: [Nov 8 05:47:37] WARNING[9357]...t
נוב 08 05:47:37 pungenday asterisk[9357]: [Nov 8 05:47:37] WARNING[9357]...r
נוב 08 05:47:37 pungenday asterisk[9357]: [Nov 8 05:47:37] WARNING[9357]...e
נוב 08 05:47:37 pungenday asterisk[9357]: [Nov 8 05:47:37] WARNING[9357]...e
נוב 08 05:47:37 pungenday asterisk[9357]: [Nov 8 05:47:37] WARNING[9357]...t
נוב 08 05:47:37 pungenday asterisk[9357]: [Nov 8 05:47:37] NOTICE[9357]:....
Hint: Some lines were ellipsized, use -l to show in full.
As you can see, I stopped asterisk and it got restarted (in the second
"status" it is running for two seconds). Asterisk has 'Restart=always'.
It is possible that it was restarted too often. At some point systemd
will give up. Could you please explain how the issue could be
reproduced?
--
Tzafrir Cohen
icq#16849755 jabber:tzafrir.cohen at xorcom.com
+972-50-7952406 mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com
More information about the Pkg-voip-maintainers
mailing list