Asterisk service in failed state even fwconsole restart is successful

We running setup with below configuration. It recently developed an issue where the asterisk service would freeze at least once 1 day. Asterisk CLI is frozen and the no logs in /var/log/asterisk/full . After fwconsole restart the system functions normally but systemctl status asterisk returns the status as failed.

Any help very much appreciated.

Config:
Asterisk 16.23.0 , FreePBX 16.0.21.18
80 extensions with 30 queues
VM with 32 core (@1Ghz) 32GB ram with SSD storage

journalctl -u asterisk -e

May 17 12:01:43 localhost.localdomain systemd[1]: Starting LSB: Asterisk PBX...
May 17 12:01:43 localhost.localdomain asterisk[4332]: Asterisk is already running.
May 17 12:01:43 localhost.localdomain systemd[1]: New main PID 29775 does not belong to service, and PID file is not owned by root. Refusing.
May 17 12:01:43 localhost.localdomain systemd[1]: New main PID 29775 does not belong to service, and PID file is not owned by root. Refusing.
May 17 12:01:43 localhost.localdomain systemd[1]: Failed to start LSB: Asterisk PBX.
May 17 12:01:43 localhost.localdomain systemd[1]: Unit asterisk.service entered failed state.
May 17 12:01:43 localhost.localdomain systemd[1]: asterisk.service failed.
May 17 12:02:28 localhost.localdomain systemd[1]: Starting LSB: Asterisk PBX...
May 17 12:02:28 localhost.localdomain asterisk[13762]: Asterisk is already running.
May 17 12:02:28 localhost.localdomain systemd[1]: Can't open PID file /var/run/asterisk/asterisk.pid (yet?) after start: No such file or directory
May 17 12:02:28 localhost.localdomain systemd[1]: Failed to start LSB: Asterisk PBX.
May 17 12:02:28 localhost.localdomain systemd[1]: Unit asterisk.service entered failed state.
May 17 12:02:28 localhost.localdomain systemd[1]: asterisk.service failed.
May 17 12:02:41 localhost.localdomain systemd[1]: Starting LSB: Asterisk PBX...
May 17 12:02:41 localhost.localdomain asterisk[16268]: Asterisk is already running.
May 17 12:02:41 localhost.localdomain systemd[1]: Can't open PID file /var/run/asterisk/asterisk.pid (yet?) after start: No such file or directory
May 17 12:02:41 localhost.localdomain systemd[1]: Failed to start LSB: Asterisk PBX.
May 17 12:02:41 localhost.localdomain systemd[1]: Unit asterisk.service entered failed state.
May 17 12:02:41 localhost.localdomain systemd[1]: asterisk.service failed.

systemctl status asterisk

‚óŹ asterisk.service - LSB: Asterisk PBX
   Loaded: loaded (/etc/rc.d/init.d/asterisk; bad; vendor preset: disabled)
   Active: failed (Result: protocol) since Wed 2023-05-17 12:02:41 +0530; 48min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 7772 ExecStop=/etc/rc.d/init.d/asterisk stop (code=exited, status=0/SUCCESS)
  Process: 16268 ExecStart=/etc/rc.d/init.d/asterisk start (code=exited, status=0/SUCCESS)
 Main PID: 2133 (code=exited, status=0/SUCCESS)

May 17 12:02:41 localhost.localdomain systemd[1]: Starting LSB: Asterisk PBX...
May 17 12:02:41 localhost.localdomain asterisk[16268]: Asterisk is already running.
May 17 12:02:41 localhost.localdomain systemd[1]: Can't open PID file /var/run/asterisk/asterisk.pid (yet?) after start: No such file or directory
May 17 12:02:41 localhost.localdomain systemd[1]: Failed to start LSB: Asterisk PBX.
May 17 12:02:41 localhost.localdomain systemd[1]: Unit asterisk.service entered failed state.
May 17 12:02:41 localhost.localdomain systemd[1]: asterisk.service failed.

What version of FreePBX/Asterisk?
Can you, as asterisk user, open /var/run/asterisk/asterisk.pid?

Saw this very old posting /var/run/asterisk/asterisk.pid

I would advise you to disable asterisk control in systemd as fwconsole can then control the user and group .

systemctl disable asterisk 
systemctl stop asterisk
fwconsole restart #if necessary