300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > centos7启动服务uthorization not available. Check if polkit service is running or see debug message for

centos7启动服务uthorization not available. Check if polkit service is running or see debug message for

时间:2019-06-10 14:54:52

相关推荐

centos7启动服务uthorization not available. Check if polkit service is running or see debug message for

事件经过

有一次远程帮助别人解决的一个问题

当时那个人给发了一个samba服务启动报错的截图

还有一个翻译图

报错信息中提到了一个polkit服务,下面先普及一下关于这个服务的知识

polkit是一个应用程序级别的工具集,通过定义和审核权限规则,实现不同优先级进程间的通讯。

控制决策集中在同一的框架之中,决定低优先级进程是否有权访问高优先级进程

polkit在系统层级进行权限控制,提供了一个低优先级进程和高优先级进程进行通信的系统

在使用systemcd 225的时候会有这类错误异常bug,但是到systemd 229的时候修复了。错误原因是当systemd启动了这个服务的时候policykit -1的postions杀掉了polkit的守护进程。在RHEL,CentOS,ubuntu,debain系统上均可以看到相关bug报告反馈。

polkit服务未运行,那就直接启动一下不就行了吗

还是一样的错误,鄙人也从没遇到过这种错误,于是上网搜了一个关于这种报错的解决方案,经过实际操作后,并没有什么效果

大概总结就是:重启系统、安装polkitt包、创建polkit用户等等。

这是红帽上面的一些评论,遇到这种问题真的靠运气去解决吗?

下面是鄙人成功解决后的一些步骤,可能是运气吧,具体为什么还在研究中…

问题解决(不是唯一)

查看错误日志

#启动服务的时候 去查看message日志taif -f /var/log/messagedbus-daemon: dbus[996]: [system] Activating via systemd: service name='org.freedesktop.PolicyKit1' unit='polkit.service'dbus[996]: [system] Activating via systemd: service name='org.freedesktop.PolicyKit1' unit='polkit.service'systemd: Starting Authorization Manager...systemd: polkit.service: main process exited, code=exited, status=1/FAILUREsystemd: Failed to start Authorization Manager.systemd: Unit polkit.service entered failed state.dbus-daemon: dbus[996]: [system] Failed to activate service 'org.freedesktop.PolicyKit1': timed outdbus[996]: [system] Failed to activate service 'org.freedesktop.PolicyKit1': timed out

然后确保存在polkitd系统用户和组

#检查并有条件的创建用户/组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"; }

#检查并有条件的重置用户/组和所有权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; }

#重启机器,并确保polkit已重新连接到dbus/usr/lib/plokit-1/plokitd -------------------------------------------------------------------reboot

重启之后,发现还是存在问题,去卸载polkit包

rpm -ef polkit包 --nodeps

因为是远程操作,忘记截图了,所以就这样写了。

卸载掉包之后重装polkit包,重新加载服务

yum -y reinstall polkitsystemctl daemon-reload#如果正常的话说明问题解决了#如果还是报错,就尝试将polkit包卸载不重装,然后在重新加载服务试试**

以上就我个人对polkit问题的一些总结,如果你用了这种方法还是没有解决掉问题,可以联系我也可以查找官网的一些其他解决方案。

redhat对此问题的解决方案:

/solutions/1543343

bug反馈:

/ubuntu/+source/policykit-1/+bug/1447654

/coreos/bugs/issues/462

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。