You are not logged in.

#1 2020-06-17 11:23:13

loggerhead
Member
Registered: 2019-07-07
Posts: 18

Polkit error when running gparted with pkexec

I want to make Gparted GUI running from Rofi menu.
GUI can be launched from terminal: sudo /usr/bin/gparted
The Rofi command should be: pkexec /usr/bin/gparted
However, after authorization an error message appears:

==== AUTHENTICATING FOR org.gnome.gparted ====
Authentication is required to run the GParted Partition Editor as root
Authenticating as: root
Password:
polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie
==== AUTHENTICATION FAILED ====
Error executing command as another user: Not authorized

I installed Gparted from:
https://www.archlinux.org/packages/extr … 4/gparted/
together with polkit-gnome.

Any idea?

Offline

#2 2020-06-17 15:15:30

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: Polkit error when running gparted with pkexec

Have you started the graphical polkit authentication agent that is supplied by the polkit-gnome package?

For example, adding this line to ~/.xinitrc would do the trick:

/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &

You really should state your desktop environment or window manager and also describe the method used to initiate the graphical desktop in the OP.

Last edited by Head_on_a_Stick (2020-06-17 15:15:53)

Offline

#3 2020-06-19 14:43:35

loggerhead
Member
Registered: 2019-07-07
Posts: 18

Re: Polkit error when running gparted with pkexec

I use i3wm.

The command you provided works for me when running gparted from terminal.

However, when I add:
exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
to my i3 config file, Gparted won't run via Rofi menu.

How to run the authentication agent by default when starting i3?

Offline

#4 2020-06-19 16:19:53

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: Polkit error when running gparted with pkexec

loggerhead wrote:

The command you provided works for me when running gparted from terminal.

That command does nothing at all if you're authenticating from a terminal, the polkit package provides /usr/bin/pkttyagent for non-graphical authentication.

loggerhead wrote:

However, when I add:
exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
to my i3 config file, Gparted won't run via Rofi menu.

Did you check if it was actually started?

pgrep -a polkit

And does running that command manually in a terminal subsequently allow you to launch gparted from Rofi?

How about with

pkexec /usr/bin/gpartedbin

And here's the relevant ArchWiki section that I should have provided in my last post: https://wiki.archlinux.org/index.php/Po … ion_agents

Offline

#5 2020-06-26 16:54:31

loggerhead
Member
Registered: 2019-07-07
Posts: 18

Re: Polkit error when running gparted with pkexec

Head_on_a_Stick wrote:

Did you check if it was actually started?

pgrep -a polkit

Yes the output shows:

752 /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
824 /usr/lib/polkit-1/polkitd --no-debug
Head_on_a_Stick wrote:

And does running that command manually in a terminal subsequently allow you to launch gparted from Rofi?

No when subsequently selected Gparted in Rofi, there is only a loading circle..

Head_on_a_Stick wrote:

How about with

pkexec /usr/bin/gpartedbin

This does not even open the Gparted window from terminal:

(gpartedbin:68450): Gtk-WARNING **: 18:38:41.885: cannot open display:

However when I run:

rofi -show run

and then select gparted the GUI runs without problem.

It would be helpful to see a rofi log file but I did not manage to find it.

Offline

Board footer

Powered by FluxBB