1

I can't restart services as root on CentOS.

Unable to register authentication agent: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.PolicyKit1 was not provided by any .service files

The polkit service isn't starting at boot.

$> systemctl status polkit
● polkit.service - Authorization Manager
   Loaded: loaded (/usr/lib/systemd/system/polkit.service; static; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:polkit(8)

If I try to start it manually:

$> systemctl status polkit
● polkit.service - Authorization Manager
   Loaded: loaded (/usr/lib/systemd/system/polkit.service; static; vendor preset: enabled)
   Active: active (running) since Wed 2016-12-07 11:15:26 GMT; 2s ago
     Docs: man:polkit(8)
 Main PID: 2079 (polkitd)
   CGroup: /system.slice/polkit.service
           └─2079 /usr/lib/polkit-1/polkitd --no-debug

Dec 07 11:15:26 sk-generic systemd[1]: Starting Authorization Manager...
Dec 07 11:15:26 sk-generic polkitd[2079]: Started polkitd version 0.112
Dec 07 11:15:26 sk-generic polkitd[2079]: Loading rules from directory /etc/polkit-1/rules.d
Dec 07 11:15:26 sk-generic polkitd[2079]: Loading rules from directory /usr/share/polkit-1/rules.d
Dec 07 11:15:26 sk-generic polkitd[2079]: Error opening rules directory: Error opening directory '/usr/share/polkit-1/rules.d': Permission denied (g-file-error-quark, 2)
Dec 07 11:15:26 sk-generic polkitd[2079]: Finished loading, compiling and executing 2 rules
Dec 07 11:15:26 sk-generic systemd[1]: Started Authorization Manager.
Dec 07 11:15:26 sk-generic polkitd[2079]: Acquired the name org.freedesktop.PolicyKit1 on the system bus

That permission denied error is suspicious (nevertheless the service seems to be running).

$> ls -l /usr/share/ | grep polkit-1
lrwxrwxrwx.   1 root      root         25 Dec  7 11:04 polkit-1 -> /usr/share.local/polkit-1
$> ls -l /usr/share.local/ | grep polkit-1
drwxr-xr-x. 4 root      root      34 Jun  9  2014 polkit-1
$> ls -l /usr/share.local/polkit-1/
total 4
drwxr-xr-x. 2 root    root 4096 Dec  7 10:53 actions
drwx------. 2 polkitd root    6 Jun  9  2014 rules.d

I have moved /usr/share and a few other post-initial-installation files to a NFS share. Yet the above permissions seem to be correct and /usr/share/polkit-1 is a symlink to a directory on the local filesystem.

Now if do something like this:

$> service network restart

the virtual machine network icon flashes for a moment but then the whole machine locks up completely. systemctl restart network fails the same way.

My original theory was that dbus was failing because inotify is not supported on NFS.

$> systemctl status dbus -l
...
Cannot setup inotify for `/usr/share/dbus-1/...

I then moved /usr/share/dbus-1 back to the local filesystem (via soft link) and rebooted, systemctl status dbus -l seems to say everything's fine, up until I run service network restart at which point the whole machine locks up with a policykit error. I moved /usr/share/polkit-1 to the local filesystem and that brings us to here.

What's wrong with policykit? Or rather, why can't services start?

spraff
  • 2,458

0 Answers0