Can't restart the asterisk service

Hi guys!
I recently ran into the problem that I cannot restart the service.

service asterisk restart

Restarting asterisk (via systemctl): Job for asterisk.service failed. See “systemctl status asterisk.service” and “journalctl -xe” for details.
[FAILED]

systemctl status asterisk.service

● asterisk.service - LSB: Asterisk PBX
Loaded: loaded (/etc/rc.d/init.d/asterisk; bad; vendor preset: disabled)
Active: failed (Result: protocol) since Sat 2020-10-24 09:22:45 MSK; 42s ago
Docs: man:systemd-sysv-generator(8)
Process: 27374 ExecStart=/etc/rc.d/init.d/asterisk start (code=exited, status=0/SUCCESS)

Oct 24 09:22:45 mypbx..com systemd[1]: Starting LSB: Asterisk PBX…
Oct 24 09:22:45 mypbx.
.com asterisk[27374]: Asterisk is already running.
Oct 24 09:22:45 mypbx..com systemd[1]: Can’t open PID file /var/run/asterisk/asterisk.pid (yet?) after start: No such file or directory
Oct 24 09:22:45 mypbx.
.com systemd[1]: Failed to start LSB: Asterisk PBX.
Oct 24 09:22:45 mypbx..com systemd[1]: Unit asterisk.service entered failed state.
Oct 24 09:22:45 mypbx.
.com systemd[1]: asterisk.service failed.

I don’t know why this started happening. What are my actions? Thank you very much in advance!

You should also look at the logs that Asterisk itself produces, as they are the ones that should explain why it shut down early.

/var/log/asterisk/full ??

Also I get the given error message with rights. The most interesting thing is that nothing happened in the system. I suspect this may have happened after the update.

systemctl status asterisk.service

● asterisk.service - LSB: Asterisk PBX
Loaded: loaded (/etc/rc.d/init.d/asterisk; bad; vendor preset: disabled)
Active: failed (Result: protocol) since Sat 2020-10-24 10:26:07 BCN; 3h 18min ago
Docs: man:systemd-sysv-generator(8)
Process: 13186 ExecStart=/etc/rc.d/init.d/asterisk start (code=exited, status=0/SUCCESS)

Oct 24 10:26:07 mypbx…com systemd[1]: Starting LSB: Asterisk PBX…
Oct 24 10:26:07 mypbx…com asterisk[13186]: Asterisk is already running.
Oct 24 10:26:07 mypbx…com systemd[1]: New main PID 11312 does not belong to service, and PID file is not owned by root. Refusing.
Oct 24 10:26:07 mypbx…com systemd[1]: New main PID 11312 does not belong to service, and PID file is not owned by root. Refusing.
Oct 24 10:26:07 mypbx…com systemd[1]: Failed to start LSB: Asterisk PBX.
Oct 24 10:26:07 mypbx…com systemd[1]: Unit asterisk.service entered failed state.
Oct 24 10:26:07 mypbx…com systemd[1]: asterisk.service failed.

And process 11312 - it’s Asterisk:
Connected to Asterisk 16.13.0 currently running on mypbx (pid = 11312)

What do you think? What I need to do?

The logs that you are providing are only showing that Asterisk is terminating very soon after being started. They are not showing why. Yo need to provide the logs produced by Asterisk to have a chance of finding out why.

/var/log/asterisk/full should be useful, but isn’t normally enabled.

Another approach is to try and start Asterisk interactively, with “asterisk -cvvvv”, and any other relevant parameters, from a root console session. Look for console messages explaining a problem.

it shows:

journalctl -xe


– Unit asterisk.service has begun starting up.
Oct 24 22:35:12 mypbx…comu asterisk[615]: Asterisk is already running.
Oct 24 22:35:12 mypbx…com systemd[1]: Can’t open PID file /var/run/asterisk/asterisk.pid (yet?) after start: No such file or directory
Oct 24 22:35:12 mypbx…com systemd[1]: Failed to start LSB: Asterisk PBX.
– Subject: Unit asterisk.service has failed
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit asterisk.service has failed.

– The result is failed.
Oct 24 22:35:12 mypbx…com systemd[1]: Unit asterisk.service entered failed state.
Oct 24 22:35:12 mypbx…com systemd[1]: asterisk.service failed.
Oct 24 22:35:12 mypbx…com polkitd[693]: Unregistered Authentication Agent for unix-process:609:1010621 (system bus name :1.766, object pat
Oct 24 22:35:12 mypbx…com systemd[1]: Removed slice User Slice of asterisk.
– Subject: Unit user-995.slice has finished shutting down
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit user-995.slice has finished shutting down.
Oct 24 22:35:16 mypbx…com runuser[644]: pam_unix(runuser:session): session opened for user asterisk by (uid=0)
Oct 24 22:35:16 mypbx…com runuser[644]: pam_unix(runuser:session): session closed for user asterisk

As I understand this is a chmod issue.
File in /var/run/asterisk/asterisk.pid is missing.
I don’t know where to start yet.
The log /var/log/asterisk/full is huge, I can’t figure out what kind of error occurs (

Where you go from here I have already posted twice.

The .pid directory entry is created by Asterisk when it successfully starts, and is removed when it terminates.

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