@Furious-George: Thank you very much. This really helped me out. I was getting this error:
asterisk.service - LSB: Asterisk PBX
Loaded: loaded (/etc/init.d/asterisk; bad; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2017-04-06 20:42:10 WAT; 8s ago
Docs: man:systemd-sysv-generator(8)
Process: 22804 ExecStart=/etc/init.d/asterisk start (code=exited, status=2)
systemd[1]: Starting LSB: Asterisk PBX…
asterisk[22804]: * Starting Asterisk PBX: asterisk
asterisk[22804]: start-stop-daemon: unable to start /usr/sbin/ (Permission denied)
Apr 06 20:42:10 vps.ui.edu.ng systemd[1]: asterisk.service: Control process exited, code=exited status=2
systemd[1]: Failed to start LSB: Asterisk PBX.
systemd[1]: asterisk.service: Unit entered failed state.
systemd[1]: asterisk.service: Failed with result ‘exit-code’.
But after following your outline above, it runs smoothly. But I’m yet to understand the last two lines displayed below :
● asterisk.service - Asterisk PBX and telephony daemon
Loaded: loaded (/etc/systemd/system/asterisk.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Thu 2017-04-06 21:39:22 WAT; 1s ago
Docs: man:asterisk(8)
Process: 24081 ExecStop=/usr/sbin/asterisk -rx core stop now (code=exited, status=217/USER)
Process: 24080 ExecStart=/usr/sbin/asterisk -f -C /etc/asterisk/asterisk.conf (code=exited, status=217/USER)
Main PID: 24080 (code=exited, status=217/USER)
systemd[1]: asterisk.service: Unit entered failed state.
asterisk.service: Failed with result ‘exit-code’.
What should be done the clear this new status errors:
systemd[1]: asterisk.service: Unit entered failed state.
asterisk.service: Failed with result ‘exit-code’.