lonkamikaze/powerdxx

"service powerdxx oneextracommands" results in "eval: cannot open /var/run/powerd.pid: Permission denied"

Closed this issue · 3 comments

0mp commented

When I run service powerdxx oneextracommands as a normal user I get:

eval: cannot open /var/run/powerd.pid: Permission denied

I don't get this error message when running this command as root.

If I stop powerdxx and then run service powerdxx oneextracommands as a normal user then I do not get that error message.

The pidfile is created with the permissions 0600. Powerd needs to be run with root privileges in order to change cpu frequencies, so the ownership is root:wheel 0600. Once you stop the service there is no pidfile.

You get the same message when querying other services like cron:

service cron extracommands
eval: cannot open /var/run/cron.pid: Permission denied

That the error message is not suppresed (especially since it's not relevant for the command run) is probably an artifact of rc.subr(8).

The question is, is this an issue, if so then:

  • Should I change the permissions for the pidfile?
  • Should rc.subr be fixed:
    • either check_pidfile should fail silently
    • or check_pidfile should not be run for commands that do not require access to the runtime state of a service

Closed due to lack of interest.

Thank you for your contribution.