Startup script for FreePBX
As most distributions have moved to systemd, here’s an example startup script that you may customize for your installation.
This has been tested to work on CentOS 7.
Contents of /etc/systemd/system/freepbx.service
[Unit]Description=FreePBX VoIP ServerAfter=mariadb.service[Service]Type=oneshotRemainAfterExit=yesExecStart=/usr/sbin/fwconsole start -qExecStop=/usr/sbin/fwconsole stop -q[Install]WantedBy=multi-user.target |
From there you can enable it so it starts automatically
Note that on Debian 8.1, you need to use After=mysql.service, not After=mariadb.service.
[root@firewall ~]# systemctl enable freepbx.serviceln -s '/etc/systemd/system/freepbx.service' '/etc/systemd/system/multi-user.target.wants/freepbx.service'[root@firewall ~]# |
And then start it yourself if you haven’t already
[root@firewall ~]# systemctl start freepbx[root@firewall ~]# |
You can check the output of the startup with the ‘systemctl status’ command
[root@firewall ~]# systemctl status -l freepbx.servicefreepbx.service - FreePBX VoIP Server Loaded: loaded (/etc/systemd/system/freepbx.service; enabled) Active: active (exited) since Mon 2015-08-17 09:20:09 AEST; 52s ago Process: 5020 ExecStart=/usr/sbin/fwconsole start (code=exited, status=0/SUCCESS) Main PID: 5020 (code=exited, status=0/SUCCESS)Aug 17 09:20:06 firewall.xrobau.com fwconsole[5020]: Running Sysadmin HooksAug 17 09:20:06 firewall.xrobau.com fwconsole[5020]: Starting Asterisk...Aug 17 09:20:09 firewall.xrobau.com fwconsole[5020]: Asterisk Started on 5523Aug 17 09:20:09 firewall.xrobau.com fwconsole[5020]: Running Post-Asterisk ScriptsAug 17 09:20:09 firewall.xrobau.com systemd[1]: Started FreePBX VoIP Server.[root@firewall ~]# |