FreePBX & asterisk not starting on system boot

Hello,

I got a problem with a SNG Distro. On rebooting asterisk does not start at all and I am not sure what logs should I check to find out what is causing it. I got the following

[root@utelit-vm-pbx monitor]# systemctl status freepbx
● freepbx.service - FreePBX VoIP Server
   Loaded: loaded (/usr/lib/systemd/system/freepbx.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Tue 2018-04-03 08:45:38 EEST; 1h 5min ago
  Process: 1482 ExecStart=/usr/sbin/fwconsole start (code=exited, status=1/FAILURE)
 Main PID: 1482 (code=exited, status=1/FAILURE)

Apr 03 08:44:14 utelit-vm-pbx fwconsole[1482]: [------------->--------------] 12 secs
Apr 03 08:44:14 utelit-vm-pbx fwconsole[1482]: [-------------->-------------] 13 secs
Apr 03 08:44:14 utelit-vm-pbx fwconsole[1482]: [--------------->------------] 13 secs
Apr 03 08:44:14 utelit-vm-pbx fwconsole[1482]: In Start.class.php line 181:
Apr 03 08:44:14 utelit-vm-pbx fwconsole[1482]: Unable to connect to Asterisk. Did it start?
Apr 03 08:44:14 utelit-vm-pbx fwconsole[1482]: start [--pre] [--post] [--skipchown] [--] [<args>]...
Apr 03 08:44:14 utelit-vm-pbx systemd[1]: freepbx.service: main process exited, code=exited, status=1/FAILURE
Apr 03 08:45:38 utelit-vm-pbx systemd[1]: Failed to start FreePBX VoIP Server.
Apr 03 08:45:38 utelit-vm-pbx systemd[1]: Unit freepbx.service entered failed state.
Apr 03 08:45:38 utelit-vm-pbx systemd[1]: freepbx.service failed.


[root@utelit-vm-pbx monitor]# systemctl status asterisk
● asterisk.service - LSB: Asterisk PBX
   Loaded: loaded (/etc/rc.d/init.d/asterisk; bad; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:systemd-sysv-generator(8)

Distro is 12.7.4-1803-1.sng7 (SNG7) with all the current updates. It is in a VM (ESXi) and it was updated some months ago from FreePBX Distro 6.10

Any help would be appreciated.

Regards,
esarant

The only solution I found till now is it do a fwconsole restart after the machine has booted up. Else asterisk wont start.

Add that as the last step in your /etc/local.rc and you should be good to go.

Could you give a little more detail on how to do that?
My issue is when it restarts after a power outage that outlasts our UPS I need it to be up and running automatically. Can’t rely on any one to know how to do anything at all.

(At the same time, it seems that if I wait a few minutes it does eventually restart asterisk, but I’m not sure if that is from me reloading the GUI to check–is there any way of seeing at what point in the startup the asterisk connection was made?)

Log into the console as ‘root’.

Edit the /etc/rc.local file (If it isn’t found, try the /etc/local.rc file)

Go to the last line of the file and open a new line.

Type in “fwconsole restart”.

Save the file.

Thanks so much for that. I know this might be off topic, but after the shut-down/restart from power outage, I need to reboot all phones to get BLF back up.

Could I put a line in this same file to automate the reboot of the phones after the fwconsole restart ?
I am thinking ```
pjsip send notify reboot-yealink endpoint [extn numbers]

Thanks again.

This no longer reboots yealink phones, and it is my fault.

I put in an issue last year to get the ability to have EPM not forcibly reboot yealink phones when they reprovision.

Instead of creating a new notify command for reload, the existing reboot command was simply changed to not force a reboot.

Go into Admin → Config Edit → sip_notify_custom.conf and add this.

[restart-yealink]
Event=>check-sync\;reboot=true

Then you can call that from your script.

You would use asterisk -rx "pjsip send notify restart-yealink endpoint [ext numbers]

I also added one named reload, for my own benefit in my scripts.

1 Like

I found that line did work from the CLI-the phones rebooted.
Are you saying I would need to alter the config file in that way, and then alter the /etc/local.rc file with the 2nd part of your answer if I want the phones to reboot automatically after restarting Asterisk?

If you are on the current version of EPM, it should not have rebooted a Yealink phone.
https://issues.freepbx.org/browse/FREEPBX-18131

Yes.

Assuming that the /etc/local.rc does this now, yes.

Not on EPM. Just the latest base model. SNG7 I think.

I’m going to open a new thread. This just will not work for me.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.