nginx报错

重启nginx时报错

(py3env) laowang@LuGe:~$ /etc/init.d/nginx restart
[....] Restarting nginx (via systemctl): nginx.serviceFailed to restart nginx.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files
See system logs and 'systemctl status nginx.service' for details.
 failed!

根据提示输入 systemctl status nginx.service 可查看nginx系统日志,查看以后并没有错误
这种情况解决办法就是命令前面加上sudo

(py3env) laowang@LuGe:~$ sudo /etc/init.d/nginx restart
[sudo] password for laowang: 
[ ok ] Restarting nginx (via systemctl): nginx.service.

重启成功

你可能感兴趣的:(nginx报错)