Centos7

CentOS 7 無法啟動服務

  • September 13, 2020

突然,我無法在我的 VPS(CentOS 7)上啟動服務。例如,

service httpd start
Redirecting to /bin/systemctl start  httpd.service
Authorization not available. Check if polkit service is running or see debug message for more information.
Failed to start httpd.service: Connection timed out
See system logs and 'systemctl status httpd.service' for details.

這可能是因為我用作主機名的域名已經過期。我不知道 service 命令背後的邏輯。我啟動httpd,為什麼會呼叫polkit服務?polkit 服務也死了,無法啟動。“service polkit status -l”命令顯示一條消息:

Lost the name org.freedesktop.PolcyKit1 - exiting

如何解決問題?

你需要使用sudo

[user@localhost ~]$ sudo systemctl start httpd

或登錄為root

[root@localhost ~]# systemctl start httpd

為了啟動和停止服務。

引用自:https://serverfault.com/questions/1033709