reboot重启服务器后发现所有服务无法启动
执行
service httpd status
后显示
Authorization not available. Check if polkit service is running or see debug message for more information.
于是去检查 polkit.service 执行
service polkit start
Redirecting to /bin/systemctl start polkit.service
Authorization not available. Check if polkit service is running or see debug message for more information.
Failed to start polkit.service: Connection timed out
See system logs and 'systemctl status polkit.service' for details.
发现无法启动 执行
service polkit status
查看详情
● polkit.service - Authorization Manager
Loaded: loaded (/usr/lib/systemd/system/polkit.service; static; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2023-05-06 23:26:40 CST; 30s ago
Docs: man:polkit(8)
Process: 3602 ExecStart=/usr/lib/polkit-1/polkitd --no-debug (code=exited, status=127)
Main PID: 3602 (code=exited, status=127)May 06 23:26:40 iZ2zefmrr626i4uec041chZ systemd[1]: Starting Authorization Manager...
May 06 23:26:40 iZ2zefmrr626i4uec041chZ polkitd[3602]: /usr/lib/polkit-1/polkitd: error while loading shared libraries: libstdc++.so.6: wrong ELF class: ELFCLASS32
May 06 23:26:40 iZ2zefmrr626i4uec041chZ systemd[1]: polkit.service: main process exited, code=exited, status=127/n/a
May 06 23:26:40 iZ2zefmrr626i4uec041chZ systemd[1]: Failed to start Authorization Manager.
May 06 23:26:40 iZ2zefmrr626i4uec041chZ systemd[1]: Unit polkit.service entered failed state.
May 06 23:26:40 iZ2zefmrr626i4uec041chZ systemd[1]: polkit.service failed.
定位到错误为so库软链接建立错误
查看当前软链接
strings /usr/lib64/libstdc++.so.6 | grep GLIBC
发现链接有误
执行
cd /usr/lib64
进入对应文件夹
执行
rm -rf libstdc++.so.6
删除错误软链接
执行
ln -s libstdc++.so.6.0.26 libstdc++.so.6
建立正确链接
尝试重启 polkit.service
service polkit start
显示
Redirecting to /bin/systemctl start polkit.service
可以启动
查看polkit.service状态
service polkit status
Redirecting to /bin/systemctl status polkit.service
● polkit.service - Authorization Manager
Loaded: loaded (/usr/lib/systemd/system/polkit.service; static; vendor preset: enabled)
Active: active (running) since Sat 2023-05-06 23:42:39 CST; 6s ago
Docs: man:polkit(8)
Main PID: 4801 (polkitd)
CGroup: /system.slice/polkit.service
└─4801 /usr/lib/polkit-1/polkitd --no-debugMay 06 23:42:39 iZ2zefmrr626i4uec041chZ systemd[1]: Starting Authorization Manager...
May 06 23:42:39 iZ2zefmrr626i4uec041chZ polkitd[4801]: Started polkitd version 0.112
May 06 23:42:39 iZ2zefmrr626i4uec041chZ polkitd[4801]: Loading rules from directory /etc/polkit-1/rules.d
May 06 23:42:39 iZ2zefmrr626i4uec041chZ polkitd[4801]: Loading rules from directory /usr/share/polkit-1/rules.d
May 06 23:42:39 iZ2zefmrr626i4uec041chZ polkitd[4801]: Finished loading, compiling and executing 2 rules
May 06 23:42:39 iZ2zefmrr626i4uec041chZ systemd[1]: Started Authorization Manager.
May 06 23:42:39 iZ2zefmrr626i4uec041chZ polkitd[4801]: Acquired the name org.freedesktop.PolicyKit1 on the system bus
May 06 23:42:39 iZ2zefmrr626i4uec041chZ polkitd[4801]: Registered Authentication Agent for unix-process:4786:261697 (system bus name :1.41 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
May 06 23:42:39 iZ2zefmrr626i4uec041chZ polkitd[4801]: Unregistered Authentication Agent for unix-process:4786:261697 (system bus name :1.41, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
再尝试启动 httpd.service 成功解决