The officially official Devuan Forum!

You are not logged in.

#1 Today 12:53:54

Altoid
Member
Registered: 2017-05-07
Posts: 2,009  

[SOLVED] gparted will not start

Hello:

Today I tried to start gparted from the menu but it will not start.
I searched the logs but found nothing.

If I try to start it as root from the cmd line, I get this:

# gparted
(gpartedbin:7345): Gtk-WARNING **: 09:37:51.663: cannot open display: 
# 

That said, I can start parted as root from the cmd line so my guess is that it is probably (?) a display server issue but /var/log/Xorg.0.log has nothing to say.

I cannot recall when I last used gparted, but I do recall it was working properly.

Being in a rush, I reinstalled it (no my usual procedure) but the problem subsists.
I don't want my weekly drive image to have this.

Where to look for the source of the problem?

Best,

A.

Offline

#2 Today 13:01:27

rolfie
Member
Registered: 2017-11-25
Posts: 1,423  

Re: [SOLVED] gparted will not start

When starting gparted from the menu you should be asked for root credentials. Does that happen? This "cannot open display" indicates at some permission issues. Have you changed the policy kit?

Offline

#3 Today 13:51:05

steve_v
Member
Registered: 2018-01-11
Posts: 676  

Re: [SOLVED] gparted will not start

rolfie wrote:

"cannot open display" indicates at some permission issues.

No, it indicates that GTK cannot open the X display <null> (note the trailing ":[nothing]" in "cannot open display:"), likely because the DISPLAY variable is not set in root's environment.

Altoid wrote:

If I try to start it as root from the cmd line, I get this:

Which "cmd line"? A real TTY? an xterm? whatever terminal emulator from whatever DE you're using?
GUI terminal emulators usually set DISPLAY, but su may or may not strip environment for security - I don't recall how it's configured in Debian these days. Check output  of 'env'.
SSH logins and TTYs do not, so one usually needs to correctly set DISPLAY and authorise the launching user to connect to the server (with e.g. xhost), see the X manual.

Regarding gparted not starting from the menu, I don't use gparted myself but the usual solution for GUI applications that need to run as root but don't handle privilege escalation themselves is to use some kind of launcher - pkexec (with org.freedesktop.policykit.exec.allow_gui set, see 'man pkexec'), gksu, kdesu etc.
Since OP didn't specify what command this "menu" is launching (or even what "menu" they're talking about, in which DE/WM), that's where my guessing ends on this one.

Last edited by steve_v (Today 14:05:41)


Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.

Offline

#4 Today 13:57:36

Altoid
Member
Registered: 2017-05-07
Posts: 2,009  

Re: [SOLVED] gparted will not start

Hello:

Thanks for the prompt reply.
Much appreciated.

rolfie wrote:

... starting gparted from the menu you should be asked for root credentials.
... indicates at some permission issues.

Yes, I know.
It does not do anything.
ie: start or ask for credentials.

rolfie wrote:

... changed the policy kit?

Hmm ...
Can't say, don't think so.

This is my polkit applications list:

$ apt list | grep installed | grep polkit
--- snip ---
gir1.2-polkit-1.0/oldstable,now 122-3devuan2 amd64 [installed,automatic]
libpolkit-agent-1-0/oldstable,now 122-3devuan2 amd64 [installed]
libpolkit-gobject-1-0/oldstable,oldstable,now 122-3devuan2 all [installed,automatic]
libpolkit-gobject-elogind-1-0/oldstable,now 122-3devuan2 amd64 [installed,automatic]
polkitd/oldstable,now 122-3devuan2 amd64 [installed,automatic]
$
$ 
$ aptitude why polkitd
i   gparted     Depends policykit-1             
i A policykit-1 Depends polkitd (= 122-3devuan2)
$ 

Apparently gparted has its needed policykit-1.

I just tried doing something with disks which opens up as usual but when I attempt to check a partition in a non-system drive, I get an error pop-up:

udisks wrote:

Error unmounting filesystem
Not authorised to perform operation (udisks-error-quark, 4)

There are entries in /var/log/auth.log reflecting this ...

--- snip ---
10:45:01 devuan CRON[5190]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
10:45:01 devuan CRON[5191]: pam_unix(cron:session): session opened for user groucho(uid=1000) by (uid=0)
10:45:01 devuan CRON[5190]: pam_unix(cron:session): session closed for user root
10:45:01 devuan CRON[5191]: pam_unix(cron:session): session closed for user groucho

... but not for attempting to start gparted from the menu.

From the cmd line I get this:

--- snip ---
10:51:35 devuan su: pam_unix(su-l:auth): authentication failure; logname= uid=1000 euid=0 tty=/dev/pts/2 ruser=groucho rhost=  user=ro$

10:51:37 devuan su[5758]: FAILED SU (to root) groucho on pts/2
10:52:04 devuan su[5774]: (to root) groucho on pts/2
10:52:04 devuan su[5774]: pam_unix(su-l:session): session opened for user root(uid=0) by (uid=1000)

Maybe (?) all this is happening due to my purging / uninstalling PCManFM and installing Xfe?

Best,

A.

Offline

#5 Today 14:00:59

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,873  

Re: [SOLVED] gparted will not start

"su" vs. "su -" problem? https://dev1galaxy.org/viewtopic.php?id=6294

Some pinentry package should be there to ask for your password when you try to start gparted from the menu.

Offline

#6 Today 14:06:25

steve_v
Member
Registered: 2018-01-11
Posts: 676  

Re: [SOLVED] gparted will not start

'gparted' appears (at least on Gentoo, I have no GUI Devuan installs) to be a shell script which ends up calling pkexec --disable-internal-agent '/usr/bin/gparted' if pkexec is available.
See if that command works in a terminal emulator as your normal (non root) user, and what output it produces.


Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.

Offline

#7 Today 14:14:20

Altoid
Member
Registered: 2017-05-07
Posts: 2,009  

Re: [SOLVED] gparted will not start

Hello:

Here you go. 8^)

steve_v wrote:

Which "cmd line"?

... LXTerminal or Tilix

steve_v wrote:

Check output  of 'env'.

$ env | grep -i display
DISPLAY=:0.0
$
steve_v wrote:

Regarding gparted not starting from the menu ...

That would be standard XFCE menu.
ie: Applications -> System -> Gparted

steve_v wrote:

OP didn't specify what command this "menu" is launching ...

The command should be whatever XFCE was set to run by default on installation.

Thanks for your input.

Best,

A.

Offline

#8 Today 14:19:55

Altoid
Member
Registered: 2017-05-07
Posts: 2,009  

Re: [SOLVED] gparted will not start

Hello:

steve_v wrote:

... if that command works in a terminal emulator as your normal (non root) user ...

$ pkexec --disable-internal-agent '/usr/sbin/gparted'
Error executing command as another user: No authentication agent found.
$ 

Best,

A.

Offline

#9 Today 14:24:41

Altoid
Member
Registered: 2017-05-07
Posts: 2,009  

Re: [SOLVED] gparted will not start

Hello:

fsmithred wrote:

"su" vs. "su -" problem?

Hmm ...
When su - was mandated, I started to use it.
Never used su again.

$ su -
Password: 
# 
fsmithred wrote:

... pinentry package should be there to ask for your password ...

Yes.
That was the usual routine.

Best,

A.

Offline

#10 Today 14:32:20

steve_v
Member
Registered: 2018-01-11
Posts: 676  

Re: [SOLVED] gparted will not start

# gparted
(gpartedbin:7345): Gtk-WARNING **: 09:37:51.663: cannot open display: 
# 

...

$ env | grep -i display
DISPLAY=:0.0
$

You ran the first as root and the second as a user, so environment is obviously going to be different. If you want to know why you got "cannot open display:", test under the same conditions you got "cannot open display:".

The command should be whatever XFCE was set to run by default on installation.

Almost certainly an xdg .desktop file dropped by the gparted package (dpkg -L gparted) and looking in it will tell you which command is being called. This is GNU/Linux, there is no "standard" anything and not everyone runs XFCE.

Ed. Anyhow, this is all irrelevant. Your polkit install doesn't work:

$ pkexec --disable-internal-agent '/usr/sbin/gparted'
Error executing command as another user: No authentication agent found.
$ 

Do you have an appropriate (GUI) agent installed (e.g. xfce-polkit)?

Package: polkit-1-auth-agent
State: not a real package
Provided by: cinnamon (6.4.10-2), gnome-flashback (3.56.0-1), gnome-shell (48.7-0+deb13u2), lxpolkit (0.5.6-2), lxqt-policykit (2.1.0-1), mate-polkit (1.26.1-4+b1), phosh
             (0.46.0-3), polkit-kde-agent-1 (4:6.3.6-1), ukui-polkit (1.2.2.2-1.1+b1), xfce-polkit (0.3+v20220621-3~excalibur1)

Also see fsmithred's comment WRT pinentry above.

Maybe (?) all this is happening due to my purging / uninstalling PCManFM and installing Xfe?

The pcmanfm package recommends lxpolkit or polkit-1-auth-agent, xfe does not. If nothing else you have installed depends on polkit-1-auth-agent, it's possible you (auto)removed it.

Last edited by steve_v (Today 14:57:32)


Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.

Offline

#11 Today 16:04:11

Altoid
Member
Registered: 2017-05-07
Posts: 2,009  

Re: [SOLVED] gparted will not start

Hello:

steve_v wrote:

... pcmanfm package recommends lxpolkit or polkit-1-auth-agent ...
... it's possible you (auto)removed it.

Indeed ... 8^°

That was it.
lxpolkit was not present so I installed it and set it up as required in Applications -> Settings -> Session and startup.
Now everything works as it should, disks and gparted wise.

Thanks for your input (both you and all those who pitched in).
Much obliged.

Best,

A.

Offline

Board footer