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,
Xavier


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,
Xavier