pidfile not readable by any user for chronyd and syslog
The pidfile for both chronyd and syslog are not readable by all users.
For chronyd, the file is in the
/run/chronyd/ directory which is 0640.
soju:~/aports/testing/openrc-exporter$ sudo ls -ld /run/chrony/ drwxr-x--- 2 chrony chrony 80 Apr 20 08:09 /run/chrony/ soju:~/aports/testing/openrc-exporter$ sudo ls -ld /run/chrony/chronyd.pid -rw-r--r-- 1 root root 5 Apr 20 08:09 /run/chrony/chronyd.pid
For syslog, the file
/run/syslogd.pid is 0640.
soju:~/aports/testing/openrc-exporter$ sudo ls -ld /run/syslogd.pid -rw-r----- 1 root wheel 5 Aug 17 2020 /run/syslogd.pid
I am working on a Prometheus exporter for OpenRC (openrc-exporter). I would like the exporter to run as non-root. This is possible as long as the pidfiles are readable by everyone. Otherwise, the function rc_service_daemons_crashed returns true for pids that cannot be read. So right now, my exporter mistakenly reports that the daemons have crashed for chronyd and syslog.
I am currently running alpine 3.12 and haven't tested in 3.13/edge but the APKBUILD/initd files seems the same.
Can this be considered as a bug that should be fixed?