Bug 920510

Summary: Gparted Won't Start Unless Launched From Terminal With Super User Authority
Product: [openSUSE] openSUSE Distribution Reporter: Antoine Saroufim <Antoine.Saroufim>
Component: GNOMEAssignee: Dominique Leuenberger <dimstar>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: Antoine.Saroufim, dimstar, fcrozat, forgotten_4FNdfJxaPM, mail
Version: Leap 42.1   
Target Milestone: Leap 42.1 Beta 1   
Hardware: x86-64   
OS: openSUSE 42.1   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Error dialogue

Description Antoine Saroufim 2015-03-04 03:30:33 UTC
Launching gparted from the Applications Overview doesn't start it. Instead, the only way to launch it is to start it from a root session in Terminal. I suggest gnomesu is used to remedy this.
Comment 1 Dominique Leuenberger 2015-03-04 10:09:58 UTC
gnomesu is dead.. let's not resurrect that beast.

gparted contains this as Exec line:

Exec=pkexec /usr/sbin/gparted %f

Can you try to execute this on a command line to see what this gives for you?
Comment 2 Dominique Leuenberger 2015-03-04 17:04:37 UTC
And to clarify: was this in a X-session or in a wayland session? I seem to be able to reproduce it in a wayland session (well, THAT will be fun!)
Comment 3 Antoine Saroufim 2015-03-04 17:45:44 UTC
Exec=pkexec /usr/sbin/gparted %f results in a small error window popping up and it says that root privilages are required for running gparted. If gnomesu is dead then perhaps gksu can be used instead? There surely must be a way for the user to launch it graphically.
Comment 4 Dominique Leuenberger 2015-03-04 18:49:24 UTC
pkexec IS the way to launch it graphically.. and it is what is in the .desktop file to start it.

gksu/gnomesu... all those are not the way to do things in 2015 :) pkexec is policykit controlled and is exactly the right thing.

of course I have no idea what 'the small error window' is that pops up and what it says exactly... but it MIGHT be the dialog asking for the root password.. then that would be pretty normal (gnomesu/gksu would do the same: they'd ask for the root password)
Comment 5 Antoine Saroufim 2015-03-05 00:56:03 UTC
Created attachment 625452 [details]
Error dialogue

This is the error I get after using the command you provided.
Comment 6 Antoine Saroufim 2015-03-05 00:57:25 UTC
Okay, apparently I can launch gparted if I run the following:
pkexec /usr/sbin/gparted

The "exec=" and "%f" parts were causing trouble. Everything works fine without them.
Comment 7 Dominique Leuenberger 2015-03-05 01:38:58 UTC
(In reply to Antoine Saroufim from comment #6)
> Okay, apparently I can launch gparted if I run the following:
> pkexec /usr/sbin/gparted
> 
> The "exec=" and "%f" parts were causing trouble. Everything works fine
> without them.

Exec= is the key in the .desktop file for the DE to know what to launch; and %f is being translated as needed by the shell as well..

so in fact, pkexec /usr/sbin/gparted is what the shell will fire up as well.

So the question would now be: why can you start it from CLI with the same command, if you can't start it from the apps overview...
Comment 8 Frederic Crozat 2015-03-26 13:01:27 UTC
to reproduce easily: use GNOME 3.16 live image and try to start gparted from gnome-shell.

starting it from gnome-terminal works fine.
Comment 9 Bruno Pesavento 2015-04-10 08:42:18 UTC
Confirming gparted not running from gnome-shell and running from root terminal in Tumbleweed 20150403 (and possibly 20150330).
Using Gnome 3.16, Gnome-session (non-wayland), reproducible always.
Other apps requiring root permission to access some resources (for instance modem-manager-gui) segfault from gnome shell but run ok from root terminal.
Comment 10 Bruno Pesavento 2015-09-22 13:12:04 UTC
The problem is still there in Leap 42.1 M2 Gnome (and the current Tumbleweed).
Starting GParted from the desktop launcher, the journal shows:

"set 22 14:54:28 localhost gparted.desktop[2211]: Refusing to render service to dead parents."

Might the cause be the structure (a "gparted" script that calls a "gpartedbin" executable), or possibly
the "libparted : 3.2" thing that shows on a terminal but has nowhere to go when invoked from the launcher?

BTW, LXDE is affected too, while in KDE4 and Plasma5 GParted starts from the launcher without a glitch.
Other superuser apps (like ModemManager GUI) now work OK on Gnome.
Comment 11 Forgotten User 4FNdfJxaPM 2015-09-22 20:44:08 UTC
When I try to open Gparted, it doesn't ask for admin password. It closes right away. When I open terminal and be super user, I type gparted and it opens.

I use both Tumbleweed and Leap Milestone 2.
Comment 12 Bruno Pesavento 2015-09-29 12:53:25 UTC
Still there on Leap 42.1 Beta 1
Comment 13 Dominique Leuenberger 2015-09-30 16:02:58 UTC
the issue at hand is that pkexec does not like to be double forked and thus result in a PPID=1 situation..

then it basically aborts with:
  gparted.desktop[7276]: Refusing to render service to dead parents.


A slight different startup method has now been integrated into the package and submitted to GNOME:Apps; it does not avoid the double fork in itself, but the parent that is being double forked does not mind.. and that one then spawns up pkexec (which no longer has PID1 as parent).

Hence a hackaround solution.
Comment 14 Bruno Pesavento 2015-10-01 23:46:51 UTC
Tested gparted-0.23.0-66.1.x86_64.rpm on openSUSE 20150924 (Tumbleweed) (x86_64)
and it starts as expected from the desktop launcher, asking for root password via pkexec.
So bug is FIXED for Tumbleweed as I see it.
Installation on Leap Beta1 fails due to older libstdc++6 at the moment.
Comment 15 Dominique Leuenberger 2015-10-06 09:43:04 UTC
Fix landed in Leap 42.1 / Current repositories
Comment 16 Bruno Pesavento 2015-10-06 13:58:35 UTC
Confirming FIXED in Leap 42.1 B1 with gparted-0.23.0-5.1.x86_64
Comment 17 Bernhard Wiedemann 2017-09-01 20:01:33 UTC
This is an autogenerated message for OBS integration:
This bug (920510) was mentioned in
https://build.opensuse.org/request/show/520245 Factory / gparted