作为 nagios 用户,我无法执行 systemctl。追踪到pkexec,我得到:
-sh-4.2$ pkexec systemctl reload nagios
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ===
Authentication is needed to run `/bin/systemctl' as the super user
但是,我有一个非常非常宽松的 polkit 规则(它不是生产系统)
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.systemd1.manage-units") {
var verb = action.lookup("verb");
if (verb == "start" || verb == "stop" || verb == "restart" || verb == "reload") {
return polkit.Result.YES;
}
}
});
我在重新启动 polkit.service 时仔细检查它是否编译有什么问题?
OS : RHEL7
Sytemd version 219
PolKit version : 0.112
谢谢,
泽维尔