错误描述
用 systemctl restart v2ray
重启你的v2ray服务时,提示
Authorization not available. Check if polkit service is running or see debug message for more information.
版本:CentOS 7.7.1908 目的:给域名装SSL证书时中断,遂重启v2ray失败,未reboot
这是由于pokit服务出现问题,一切 systemctl restart
之类的命令都会失败,检查polkit,systemctl status polkit
会提示失败
错误原因
博客1中说
当使用daemon-reload或者使用restart指令来重新加载启动polkit服务的时候,竞态条件会优先序列将会发生改变,与此同时systemctl status将会立马报告polkit卡在了启动状态。但是polkit进程实际上是在运行的,系统只是简单地忽略掉了bus属主的改变。($busctl 查看)。
并且提出解决办法(截取自博客2)
手动启动 polkit /usr/lib/polkit-1/polkitd
重装pokit yum -y reinstall pokit
并启动 systemctl start pokit
之后重启v2ray
然而我并未生效,
问题解决
红帽子爆出的bug中的解决方案为
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
ww
shutdown -r now
RedHat的解决方案我尝试过后恢复了正常
引用
https://www.cnblogs.com/ramlife/p/11875470.html
https://access.redhat.com/solutions/1543343
https://blog.csdn.net/minxihou/article/details/52831152