Article 5KXN3 Policy Kit does not allow to restart a service, despite an adequate rule

Policy Kit does not allow to restart a service, despite an adequate rule

by
xavier8854
from LinuxQuestions.org on (#5KXN3)
As nagios user, I cannot execute systemctl. Tracking it down to pkexec, I get :
Code:-sh-4.2$ pkexec systemctl reload nagios
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ===
Authentication is needed to run `/bin/systemctl' as the super userHowever, I have a very, very lenient polkit rule (it is a NOT a production system)

Code: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;
}
}
});I double checked it is compiled when restarting polkit.service
What is the problem ?

OS : RHEL7
Sytemd version 219
PolKit version : 0.112

Thanks,
Xavierlatest?d=yIl2AUoC8zA latest?i=Z9HMpPvETaI:ashHuwzns3w:F7zBnMy latest?i=Z9HMpPvETaI:ashHuwzns3w:V_sGLiP latest?d=qj6IDK7rITs latest?i=Z9HMpPvETaI:ashHuwzns3w:gIN9vFwZ9HMpPvETaI
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments