How to restart polkitd?

26,164

Solution 1

The man page for polkitd says:

... Users or administrators should never need to start this daemon as it will be automatically started by dbus-daemon(1) ...

Therefore polkitd will be restarted when dbus service is restarted. Since this service interacts with the desktop manager it is safer to log out of the desktop session, stop xdm service, restart dbus and start xdm again.

Solution 2

You should run:

invoke-rc.d dbus restart

as root.

Solution 3

I have been encountering the polkitd memory leak in my Ubuntu 10.04 desktop.

I use the command ps -ef | grep polkitd to find the process ID and then use kill -9 procid

The polkitd process will be killed but it will be started again by the system. And the polkitd process will once again start leaking memory.

Solution 4

When using systemd, restarting polkit is as easy as: sudo systemctl restart polkitd.service

Share:
26,164

Related videos on Youtube

Dmitri Chubarov
Author by

Dmitri Chubarov

Updated on September 18, 2022

Comments

  • Dmitri Chubarov
    Dmitri Chubarov over 1 year

    My desktop PC is also used as a NIS/NFS server for a small workgroup. It runs for months without reboot.

    Recently I observed that when I log into a desktop session the computer becomes less responsive for several minutes. A polkitd process in a D state generates a lot of disk I/O activity. Its VmSize is over 600MB and its VmRSS is over 400MB.

    The machine is still on OpenSUSE 11.3 with polkit 0.96. I plan to upgrade in the summer.

    There are several reports of memory leaks in polkitd that were fixed in 0.98 (freedesktop.org, opensuse.org). While upgrading will probably solve the problem it would take about a day and I am looking for a quick fix.

    There is no polkitd script in /etc/init.d and the parent for the polkitd process is init itself.

        PID  PPID USER     CMD
          ....
      22362     1 root     /usr/lib/polkit-1/polkitd
    

    Question: How do I restart polkitd without rebooting the system? Can I do it from within a desktop session or should I log off the desktop session and log on to the text console?

  • Dmitri Chubarov
    Dmitri Chubarov almost 10 years
    On Linux you could also use pgrep to get the process ID as in pgrep polkitd. And also pkill to kill the process with the name that matches a given pattern.
  • derobert
    derobert almost 10 years
    Does SIGTERM really not work? SIGKILL is a last resort, not a first...
  • Push
    Push almost 9 years
    Thanks. I found out that even on a headless (text-mode only) OpenSuSE you can do rcdbus restart. Needed this when zypper ps indicated that polkitd was using a deleted file and needed to be restarted after a zypper dup (I run Tumbleweed on some systems) or zypper up (on regular releases).
  • roaima
    roaima over 8 years
    Isn't this a subset of the answer offered by Dmitri Chubarov?