Polkitd misses /run/polkit-1/ on start

on each start of polkit, the journal contains the following:
Error opening rules directory: Error opening directory “/run/polkit-1/rules.d”: No such file or directory (g-file-error-quark, 4)

However, polkit starts properly, but i think the missing directory is a deviation from the specification, and therefore it is a bug by definition. I have observed this on two different EOS computers, therefore i assume this is a general thing. It would be great if some other people could check that on their computer and confirm. Check is easy by running journalctl --unit=plokit and look for the error above.

I can suggest a fix that worked for me, although it is possible that this is not the optimum fix: Too the file /usr/lib/tmpfiles.d/polkit-tmpfiles.confi added the following lines:

d /run/polkit-1 0755 polkitd polkitd -
d /run/polkit-1/rules.d 0755 polkitd polkitd -

This way, the missing directories get created on start of systemd-tmpfiles-setup.service during boot time, and the start of polkit does not throw the error above. Please confirm if that works on your computer too or not. Suggestions for better fixes are welcome as well.

That is just informational. I don’t think it is a bug in any sense.

It isn’t actually logged as an error, it, unfortunately, simply contains the word error in the text. It is just letting you know the directory isn’t there.

If you look at the priority of that journal message it is marked as “Notice” so it isn’t an error or a warning.

Thanks for the feedback. You say the log entry is not an error. I disagree for the following reasons:

  1. Using the word ERROR in a notice is a logical contradiction and does not meet expectations.
  2. polkit uses this directory to read rule that are dynamically created by other programs. If that directory is missing it is likely that functions of those programs don’t work as expected. This is a functional deviation from the specified intended use, which is by definition called a defect. In my opinion a defect is a bug, and the directory should be there in order to guarantee proper function of polkit.

Err…I wasn’t stating an opinion. Journal messages have a field called “priority”. Those messages are not marked as errors, they are tagged with the priority “notice”.

While I agree that the message is misleading, those aren’t errors, objectively speaking.

Fine with the log level.

Do you say it is ok if the directory is missing?

Yes, I don’t see anywhere in the documentation or specifications that those directories are required.

Those appear to be optional.

Thanks for the explanation. Actually, i could not find any reference on /run/polkit-1/ other that the man page that lists it as a search path and this “notice” in the logs. It finally looks like the directory is not used at all, but that is unclear. I filed an issue on that upstream.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.