I am running a NTP server on an Ubuntu 20.04 LTS. The server work fine and the client poll correctly the server. But i keep getting a permission error when i want to record statistics.
I tried to include the following lines in ntp.conf :
statistics rawstats
statsdir /var/log/ntpstats/
filegen rawstats file raw type day link enable
When looking at systemctl ntp status
:
mars 05 09:08:48 RD-NTP ntpd[3534] : can't open /var/log/ntpstats/raw.20210305: Permission denied
mars 05 09:08:50 RD-NTP ntpd[3534] : can't open /var/log/ntpstats/raw.20210305: Permission denied
mars 05 09:08:52 RD-NTP ntpd[3534] : can't open /var/log/ntpstats/raw.20210305: Permission denied
mars 05 09:08:54 RD-NTP ntpd[3534] : can't open /var/log/ntpstats/raw.20210305: Permission denied
But for me, the directory have the correct permissions ls -al
:
drwxr-xr-x 2 ntp ntp 4096 april 2 2020 .
Before choosing the default folder, i tried with one i created and adding ntp in the permission using this command : chmod ntp:ntp /home/ubuntu/ntpstats/
, it wasnt working so i switched to this one, not working either.
Do you know why ntpd keep getting error even if ntp have the upper hand on the folder ?