debian12在使用systemctl status ntpd时发现出现个权限错误
root@debian:~# systemctl status ntpd
● ntpsec.service - Network Time Service
     Loaded: loaded (/lib/systemd/system/ntpsec.service; enabled; preset: enabled)
     Active: active (running) since Fri 2024-05-24 10:25:43 CST; 16s ago
       Docs: man:ntpd(8)
    Process: 3425 ExecStart=/usr/libexec/ntpsec/ntp-systemd-wrapper (code=exited, status=0/SUCCESS)
   Main PID: 3429 (ntpd)
      Tasks: 1 (limit: 2265)
     Memory: 10.5M
        CPU: 77ms
     CGroup: /system.slice/ntpsec.service
             └─3429 /usr/sbin/ntpd -p /run/ntpd.pid -c /etc/ntpsec/ntp.conf -g -N -u ntpsec:ntpsec
May 24 10:25:43 debian ntpd[3429]: IO: Listening on routing socket on fd #22 for interface updates
May 24 10:25:43 debian ntpd[3429]: INIT: MRU 10922 entries, 13 hash bits, 65536 bytes
May 24 10:25:43 debian ntpd[3429]: INIT: Built with OpenSSL 3.0.9 30 May 2023, 30000090
May 24 10:25:43 debian ntpd[3429]: INIT: Running with OpenSSL 3.0.11 19 Sep 2023, 300000b0
May 24 10:25:43 debian ntpd[3429]: NTSc: Using system default root certificates.
May 24 10:25:43 debian ntpd[3429]: statistics directory /var/log/ntpsec/ does not exist or is unwriteable, error Permission denied
May 24 10:25:44 debian ntpd[3429]: DNS: dns_probe: ntp.aliyun.com, cast_flags:1, flags:20801
May 24 10:25:44 debian ntpd[3429]: DNS: dns_check: processing ntp.aliyun.com, 1, 20801
May 24 10:25:44 debian ntpd[3429]: DNS: Server taking: 203.107.6.88
May 24 10:25:44 debian ntpd[3429]: DNS: dns_take_status: ntp.aliyun.com=>good, 0出现个错误
statistics directory /var/log/ntpsec/ does not exist or is unwriteable, error Permission denied然后使用命令查看一下运行端口和权限:
root@debian:~# lsof -i -P -n运行账号是ntpsec,会不会是因为那个目录没有权限呢,这时去查看,发现没有/var/log/ntpsec/ 这个目录,然后我们手工创建一个ntpsec目录,并且加上权限
root@debian:~# mkdir /var/log/ntpsec/
root@debian:~# chown ntpsec:ntpsec /var/log/ntpsec/然后重启ntpd服务
root@debian:~# systemctl restart ntpd再次查看就没有报错了
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
    


![图片[2]-debian12使用ntp时查看有个错误:statistics directory /var/log/ntpsec/ does not exist or is unwriteable, error Permission denied-下雪啦资源网](https://www.xiaxuela.com/wp-content/uploads/2024/05/600d0861a046938.jpg)







![苹果cms使用火车头发布数据报错:“SQLSTATE[22001]:String data,right truncated:1406 Data too long for column ‘vod_blurb’ at row 1”-下雪啦资源网](https://www.xiaxuela.com/wp-content/uploads/2020/12/da6b8ce280dece1-300x95.png)







 
        
暂无评论内容