Centos7環境報polkit服務啟動失敗


polkit 這個是什么服務?

參考網站
https://wiki.archlinux.org/index.php/Polkit_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)
https://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html
大概知道
polkit是linux服務器上的身份認證組件,目的是讓用戶證明自己屬於某個用戶組。更詳細的內容,可以參考上面的網址。

經過百度,找到解決方法

PolicyKit failing to start with error: polkit.service: main process exited, code=exited, status=1/FAILURE

1.Ensure the existence of a polkitd system user & group

Copy/paste the following 2 compound-commands to a root terminal to check for and conditionally create the user/group

getent group polkitd >/dev/null && echo -e "\e[1;32mpolkitd group already exists\e[0m" || { groupadd -r polkitd && echo -e "\e[1;33mAdded missing polkitd group\e[0m" || echo -e "\e[1;31mAdding polkitd group FAILED\e[0m"; }
getent passwd polkitd >/dev/null && echo -e "\e[1;32mpolkitd user already exists\e[0m" || { useradd -r -g polkitd -d / -s /sbin/nologin -c "User for polkitd" polkitd && echo -e "\e[1;33mAdded missing polkitd user\e[0m" || echo -e "\e[1;31mAdding polkitd user FAILED\e[0m"; }

 

2.Reset the permissions and user/group ownership for all files provided by the polkit and polkit-pkla-compat packages

Copy/paste the following compound-command to a root terminal to check for and conditionally reset user/group perms & ownership

rpm -Va polkit\* && echo -e "\e[1;32mpolkit* rpm verification passed\e[0m" || { echo -e "\e[1;33mResetting polkit* rpm user/group ownership & perms\e[0m"; rpm --setugids polkit polkit-pkla-compat; rpm --setperms polkit polkit-pkla-compat; }

3.Reboot

A reboot of the machine will be required to make sure that all changes take affect and that polkit has reconnected to the dbus

shutdown -r now

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM