buy
CentOS 7 error restarting/starting a systemd service

Overview

If you are facing the following error while starting/restarting any service on CentOS 7 :
CentOS 7 error restarting/starting a systemd service: :Unable to register authentication agent

# service pure-ftpd start
Redirecting to /bin/systemctl start pure-ftpd.service

** (pkttyagent:478736): WARNING **: 198.168.100.138: Unable to register authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject
Error registering authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject (polkit-error-quark, 0)

NOTE : This solution is only for CentOS 7 if you are facing the same issue on any other OS please contact our support team.

Solution

Execute the following commands on your server as root to resolve this issue.

# groupadd -g 23 nohidproc
# usermod -a -G nohidproc polkitd
# mount -o remount,rw,hidepid=2,gid=nohidproc /proc
# systemctl restart polkit

** (pkttyagent:490038): WARNING **: 198.168.100.138: Unable to register authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject
Error registering authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject (polkit-error-quark, 0)

# echo u0026quot;proc /proc proc defaults,hidepid=2,gid=nohidproc 0 0u0026quot; u0026gt;u0026gt; /etc/fstab
# mount -a
# systemctl restart polkit

After executing the above commands you can try to start/restart services and it should work fine.

    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list