I was working on a system last night and noticed that when I checked the status of Asterisk it would provide an odd bad, disabled message. I tried to restart it but it just hung. Eventually I ran an asterisk-version-switch which brought it back to life but even after that when I run the asterisk status I’m not seeing the normal Running page. Any thoughts?
service asterisk status
● asterisk.service - LSB: Asterisk PBX
Loaded: loaded (/etc/rc.d/init.d/asterisk; bad; vendor preset: disabled)
Active: active (running) since Fri 2019-05-24 22:01:50 CDT; 5 days ago
Docs: man:systemd-sysv-generator(8)
Main PID: 22806
CGroup: /system.slice/asterisk.service
May 24 22:01:50 tower.cqsimple.org systemd[1]: Starting LSB: Asterisk PBX...
May 24 22:01:50 tower.cqsimple.org asterisk[23750]: Asterisk is already running.
May 24 22:01:50 tower.cqsimple.org systemd[1]: asterisk.service: Supervising....
May 24 22:01:50 tower.cqsimple.org systemd[1]: Started LSB: Asterisk PBX.
Hint: Some lines were ellipsized, use -l to show in full.
[root@tower ~]# service asterisk restart
Restarting asterisk (via systemctl): ^C
[root@tower ~]# service asterisk start
Starting asterisk (via systemctl): ^C
[root@tower ~]# service asterisk status
● asterisk.service - LSB: Asterisk PBX
Loaded: loaded (/etc/rc.d/init.d/asterisk; bad; vendor preset: disabled)
Active: deactivating (stop-sigterm) since Thu 2019-05-30 21:45:59 CDT; 3min 1 3s ago
Docs: man:systemd-sysv-generator(8)
Process: 18063 ExecStop=/etc/rc.d/init.d/asterisk stop (code=exited, status=0/ SUCCESS)
Main PID: 22806
CGroup: /system.slice/asterisk.service
service asterisk status
● asterisk.service - LSB: Asterisk PBX
Loaded: loaded (/etc/rc.d/init.d/asterisk; bad; vendor preset: disabled)
Active: deactivating (final-sigkill) (Result: timeout) since Thu 2019-05-30 21:45:59 CDT; 16min ago
Docs: man:systemd-sysv-generator(8)
Main PID: 22806
CGroup: /system.slice/asterisk.service
May 24 22:01:50 tower.cqsimple.org systemd[1]: Starting LSB: Asterisk PBX...
May 24 22:01:50 tower.cqsimple.org asterisk[23750]: Asterisk is already running.
May 24 22:01:50 tower.cqsimple.org systemd[1]: asterisk.service: Supervising process 22806 which is not our child. We'll most likely not notice when it exits.
May 24 22:01:50 tower.cqsimple.org systemd[1]: Started LSB: Asterisk PBX.
May 30 21:45:59 tower.cqsimple.org systemd[1]: Stopping LSB: Asterisk PBX...
May 30 21:45:59 tower.cqsimple.org asterisk[18063]: Stopping safe_asterisk: [ OK ]
May 30 21:45:59 tower.cqsimple.org asterisk[18063]: Shutting down asterisk: [ OK ]
May 30 21:50:59 tower.cqsimple.org systemd[1]: asterisk.service stop-sigterm timed out. Killing.
May 30 21:55:59 tower.cqsimple.org systemd[1]: asterisk.service still around after SIGKILL. Ignoring.
May 30 22:01:00 tower.cqsimple.org systemd[1]: asterisk.service stop-final-sigterm timed out. Killing.
I believe you are seeing that because on FreePBX Distro, Asterisk is not meant to be started with systemctl, but it will be started with fwconsole commands.
Just to show you my FreePBX Distro SNG7 output, even though Asterisk is running, systemctl is showing it as stopped.
Not stupid, you are not supposed to know everything, don’t worry
I’m not aware of a specific fwconsole command to check for Asterisk status, but since on FreePBX Distro Asterisk is supposed to be started by safe_asterisk, you can do a pf -es|grep safe_asterisk and then pf -ef|grep NUMBER_OF_PID_FROM_COMMAND_BEFORE just like I showed you on my previous reply
Did running service asterisk status and service asterisk restart used to be an acceptable practice? I feel like I’ve used it prior successfully. Thank you for the insight on best practices, greatly appreciated
Prior to SNG7, you could get useful output from service asterisk status, but it has never been acceptable to start asterisk with anything other than fwconsole (or amportal back before ver. 13).