Asterisk 16.14.0 on almalinux9 os

Hello,
at a new installation i am facing the following problem. I have installed almalinux 9. asterisk 16.14.0


[root@Alma-9-latest-amd64-base ~]# systemctl status asterisk
● asterisk.service - LSB: Asterisk PBX
Loaded: loaded (/etc/rc.d/init.d/asterisk; generated)
Active: active (running) since Mon 2024-05-13 17:07:35 CEST; 21min ago
Docs: man:systemd-sysv-generator(8)
Main PID: 99295 (asterisk)
Tasks: 58 (limit: 407296)
Memory: 35.4M
CPU: 1.731s
CGroup: /system.slice/asterisk.service
├─99293 /bin/sh /usr/sbin/safe_asterisk
└─99295 /usr/sbin/asterisk -f -vvvg -c

May 13 17:07:35 Alma-9-latest-amd64-base systemd[1]: asterisk.service: Can’t open PID file /run/asterisk/asterisk.pid (yet?) after start: Operation not permitted
May 13 17:07:35 Alma-9-latest-amd64-base systemd[1]: asterisk.service: Supervising process 99295 which is not our child. We’ll most likely not notice when it exits.
May 13 17:07:35 Alma-9-latest-amd64-base systemd[1]: Started LSB: Asterisk PBX.
May 13 17:07:36 Alma-9-latest-amd64-base asterisk[99295]: radcli: rc_read_config: rc_read_config: can’t open /etc/radiusclient-ng/radiusclient.conf: No such file or directory
May 13 17:07:43 Alma-9-latest-amd64-base systemd[1]: /run/systemd/generator.late/asterisk.service:30: PIDFile= references a path below legacy directory /var/run/, updating /var/run/asterisk/asterisk.pid → /run/asterisk/asterisk.pid; ple>
May 13 17:07:43 Alma-9-latest-amd64-base systemd[1]: asterisk.service: Supervising process 99295 which is not our child. We’ll most likely not notice when it exits.
May 13 17:07:50 Alma-9-latest-amd64-base systemd[1]: /run/systemd/generator.late/asterisk.service:30: PIDFile= references a path below legacy directory /var/run/, updating /var/run/asterisk/asterisk.pid → /run/asterisk/asterisk.pid; ple>
May 13 17:07:50 Alma-9-latest-amd64-base systemd[1]: asterisk.service: Supervising process 99295 which is not our child. We’ll most likely not notice when it exits.
May 13 17:08:06 Alma-9-latest-amd64-base systemd[1]: /run/systemd/generator.late/asterisk.service:30: PIDFile= references a path below legacy directory /var/run/, updating /var/run/asterisk/asterisk.pid → /run/asterisk/asterisk.pid; ple>
May 13 17:08:06 Alma-9-latest-amd64-base systemd[1]: asterisk.service: Supervising process 99295 which is not our child. We’ll most likely not notice when it exits.


after the reboot the output is:


[root@Alma-9-latest-amd64-base ~]# systemctl status asterisk
● asterisk.service - LSB: Asterisk PBX
Loaded: loaded (/etc/rc.d/init.d/asterisk; generated)
Active: active (running) since Mon 2024-05-13 17:47:11 CEST; 4s ago
Docs: man:systemd-sysv-generator(8)
Process: 1994 ExecStart=/etc/rc.d/init.d/asterisk start (code=exited, status=0/SUCCESS)
Main PID: 2025 (asterisk)
Tasks: 63 (limit: 407296)
Memory: 35.9M
CPU: 467ms
CGroup: /system.slice/asterisk.service
├─2023 /bin/sh /usr/sbin/safe_asterisk
└─2025 /usr/sbin/asterisk -f -vvvg -c

May 13 17:47:11 Alma-9-latest-amd64-base systemd[1]: Starting LSB: Asterisk PBX…
May 13 17:47:11 Alma-9-latest-amd64-base asterisk[1994]: Starting asterisk:
May 13 17:47:11 Alma-9-latest-amd64-base systemd[1]: asterisk.service: Can’t open PID file /run/asterisk/asterisk.pid (yet?) after start: Operation not permitted
May 13 17:47:11 Alma-9-latest-amd64-base systemd[1]: asterisk.service: Supervising process 2025 which is not our child. We’ll most likely not notice when it exits.
May 13 17:47:11 Alma-9-latest-amd64-base systemd[1]: Started LSB: Asterisk PBX.
May 13 17:47:12 Alma-9-latest-amd64-base asterisk[2025]: radcli: rc_read_config: rc_read_config: can’t open /etc/radiusclient-ng/radiusclient.conf: No such file or directory


the permissions and owners for these files are:

=> /etc/asterisk/asterisk.conf → asterisk:asterisk (0644)

[options]
documentation_language = en_US ; Set the language you want documentation
runuser = asterisk
rungroup = asterisk
maxfiles = 500000

[files]
astctlpermissions = 0775
astctlowner = asterisk
astctlgroup = asterisk
astctl = asterisk.ctl

=> /run/asterisk/asterisk.ctl → asterisk:asterisk (0775)
/run/asterisk/asterisk.pid → asterisk:asterisk (0644)

also, i can connect with asterisk, also have tried to do some calls and works fine but i can not find the reason of this problem and how to fix it.

Why are you trying to install a buggy, end of life, and vulnerable version of Asterisk?

Could you point out the problem, as I can’t see any.

You haven’t provided the permissions along the path to the files.

I have specified in parentheses the permission for each path:
/etc/asterisk/asterisk.conf → asterisk:asterisk ; permission (0644)
/run/asterisk/asterisk.ctl → asterisk:asterisk ; permission (0775)
/run/asterisk/asterisk.pid → asterisk:asterisk ; permission (0644)

The problem is that even though the status of asterisk is active, the error is that systemd does not recognize it. And many scripts that get information about calls do not work.

I am trying to fix this:

systemd[1]: asterisk.service: Can’t open PID file /run/asterisk/asterisk.pid (yet?) after start: Operation not permitted
systemd[1]: asterisk.service: Supervising process 2025 which is not our child. We’ll most likely not notice when it exits.

With the same asterisk version 16.14.0 or 16.30.1, I installed another servers in the previous weeks with centos or almalinux and it worked fine. Recent installs I’ve done with 16.14.0 or 16.30.1 on centos and almalinux have the same problem.

/etc should never be writeable to an ordinary user, or you have only given the permission for the leaf nodes.

None of these versions are supported.