Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 158920 - Hangs in GNOME apps when run through gksu, su or sudo
Summary: Hangs in GNOME apps when run through gksu, su or sudo
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GNOME (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-23 07:46 UTC by Le retraité
Modified: 2007-03-28 01:00 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Le retraité 2006-12-23 07:46:31 UTC
One week ago, I upgraded all my gnome packages (from 2.16.0 to 2.16.[1,2,3] depending on the package). Most of them were about 2 months old.

Before that everything was alright and now:
If I run any gnome apps logged as a regular user --> no problem
If I run any gnome apps logged as a root --> no problem (I did that for test purpose, only because of this bug)
If run any any gnome apps as a regular user but through gksu/su/sudo it hangs up.
If I run them with strace, I can see that gnome apps are waiting for a futex call.

I tried to emerge back some gnome packages like gnome-vfs but without success and there's no many of them to test them one by one.

Any hint to find out which one is the problem ?

Regards.
Comment 1 Norman Jonas 2007-01-23 02:30:02 UTC
I experience a similar problem. I can launch some apps ( gedit / gnome-terminal ) with gksu, but not e.g. nautilus. gedit crashes as soon as I try to open a file. In my case the cause is the new dbus-1.x + gnome-vfs.

Which version of dbus do you have installed - if it is 1.x then maybe you could try to downgrade to the latest 0.x version ( e.g. 0.62-r2 ) and try again ( sadly that would require to revdep-rebuild which takes a long time and I can not guarantee that this is the same problem for you as for me ...
Comment 2 Le retraité 2007-01-25 16:10:13 UTC
Same here about gnome-terminal and gedit. I think we're having the same issue.

The bad news is that I've just installed a new pc, and I have the exact same problem.

I've already suspected dbus 1.x to be the problem but I'm too lazy to revdep-rebuild almost all gnome.
Comment 3 Daniel Gryniewicz (RETIRED) gentoo-dev 2007-01-26 02:41:23 UTC
It's not dbus-1.x.  I have that version, and gksu works fine for me with gnome-terminal and gedit.

Which version of gnome-vfs to you all have?  2.16.3 and 2.16.3-r1 have a patch to not fail if dbus isn't available.
Comment 4 Norman Jonas 2007-01-26 07:32:11 UTC
On my system ( amd64 ) this happens for any gnome-vfs version from 2.16.3 up to 2.17.90 and it only happens with dbus 1.x.
Comment 5 Le retraité 2007-01-26 09:53:45 UTC
Well, I have emerge back dbus to 0.62-r2, revdep-rebuild almost all gnome >_< and now su/gksu works fine.

So, is it a dbus bug or a gnomevfs one ?

Ubunturos seem to have the same issue with their last packages:
https://launchpad.net/ubuntu/+source/dbus-glib/+bug/71248

That reminded me that now gnome apps not directly use dbus but pass through dbus-glib.

Anyway, they suggest to use "su dbus-launch gdmsetup", I re-emerge dbus-1.0.2 and revdep-RErebuild almost gnome... and it works.

Now we need to know between dbus/dbus-glib/gnome-vfs which one is the faulty one. Since whatever version of gnome-vfs I emerge I still have this bug, since I don't see KDE guys having problems with dbus1.x, I suppose it's dbus-glib ?

Time to open a new bug ?
Comment 6 Gilles Dartiguelongue (RETIRED) gentoo-dev 2007-01-26 10:29:19 UTC
Could you try adding something like the following lines to your /etc/sudoers :

Defaults:%users  env_keep+=DISPLAY
Defaults:%users  env_keep+=XAUTHORITY
Defaults:%users  env_keep+=DBUS_SESSION_BUS_ADDRESS

(Warning: consider the eventual security risk)

and try to run a command like :
gksudo gdmsetup
Comment 7 Norman Jonas 2007-01-26 15:25:56 UTC
(In reply to comment #6)
> Could you try adding something like the following lines to your /etc/sudoers :
> 
> Defaults:%users  env_keep+=DISPLAY
> Defaults:%users  env_keep+=XAUTHORITY
> Defaults:%users  env_keep+=DBUS_SESSION_BUS_ADDRESS
> 
> (Warning: consider the eventual security risk)
> 
> and try to run a command like :
> gksudo gdmsetup
> 

That doesn't seem to work. Yet I noticed another symptom of the bug - gnome-power-manager does not work as well - it does not show its tray icon.

And I just realized that killing the X-Server and logging in again makes everything work like it should ( gksu and gnome-power-manager ) - yet that kills other things like launching epiphany with a message like "Failed to connect to socket /tmp/dbus-UCN7HAUo1B: Verbindungsaufbau abgelehnt" which is either related or even another bug.
Comment 8 Daniel Gryniewicz (RETIRED) gentoo-dev 2007-01-31 22:37:03 UTC
True; if you're using sudo, you need to keep your environment.  By default, Gentoo's sudo nukes it.
Comment 9 Christophe 2007-02-12 19:40:11 UTC
Same problem. But my visudo shows:

# Reset environment by default
#Defaults       env_reset
# Uncomment to allow users in group wheel to export variables
Defaults:%wheel !env_reset

so unless I misread that, it does NOT reset my environment. And still gedit open but any call to dialog box hangs it.


Comment 10 Daniel Gryniewicz (RETIRED) gentoo-dev 2007-02-12 19:58:44 UTC
Interesting.  I'm seeing this now, on my new laptop.  (My old laptop is still fine)
Comment 11 Le retraité 2007-02-23 16:11:42 UTC
I have done an emerge -uDN world recently and now I have this bug even without being in su/sudo mode in one app: GIMP.

As a regular user, I need to launch dbus-launch gimp in order to make it works. If I run strace gimp I can see that futex blocking gimp while loading the modules.
Comment 12 Daniel Gryniewicz (RETIRED) gentoo-dev 2007-02-23 17:26:39 UTC
Many gnome programs won't work without a local dbus.  The number grows with every release.  You will need to run a local dbus in your session to use these programs.  I don't think this has anything to do with gksu/gksudo.

This was mentioned in the Gnome 2.16 upgrade guide:
http://www.gentoo.org/proj/en/desktop/gnome/howtos/gnome-2.16-upgrade.xml
Comment 13 Le retraité 2007-02-23 18:45:26 UTC
You're right, it has nothing to do with su/gksu since this bug is fixed by dev-libs/dbus-glib-0.73.

However your link about Gnome 2.16 say "GDM automatically starts a dbus session for you". I'm using GDM so I shouldn't have to manually start the dbus session!

I'm on Gnome 2.16 for quite a while and never had this problem until now, so I think this is really a bug (but it's not dbus-glib-0.73 fault since emerging back dbus-glib-0.72 didn't solved this problem)

Anyway I'm going to closed this bug as resolved and create a new one.
Comment 14 Daniel Gryniewicz (RETIRED) gentoo-dev 2007-02-23 18:51:31 UTC
Okay.  I'll verify that it's actually gdm that starts the dbus session, and not gnome-session.
Comment 15 Daniel Gryniewicz (RETIRED) gentoo-dev 2007-02-23 18:57:33 UTC
Okay, the page was wrong; gnome-session starts the dbus, not gdm.  I'll fix the page.
Comment 16 Le retraité 2007-02-23 21:18:32 UTC
Ok.

Isn't gnome-session started by gdm ? Because if I try to start gnome-session in console before starting GIMP it says: "you're already running a session manager"
Comment 17 Daniel Gryniewicz (RETIRED) gentoo-dev 2007-02-23 21:33:37 UTC
Typically, yes.  You can select to have gdm run somthing else, but unless you did that, it's running gnome-session.

You can see if it started a dbus session by running this from a terminal:
env | grep DBUS

It should print something like this:
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-ezo0DNF8mT,guid=0d032ad27b74671f5b4f460045ddb31c
Comment 18 nm (RETIRED) gentoo-dev 2007-02-24 06:58:24 UTC
Yup, I get the weird "gdmsetup doesn't launch unless you run it with 'dbus-launch gdmsetup' as root" bug.

So, is the fix to use dbus-glib .73? The one in ~arch (on amd64)? How 'bout stabilizing it? ;)
Comment 19 Le retraité 2007-02-24 19:33:30 UTC
@Josh: yes 0.73 fix the problem.

@Daniel: yes i get the right output, dbus sessions is started.
Comment 20 Daniel Gryniewicz (RETIRED) gentoo-dev 2007-02-26 16:44:17 UTC
I'd say re-emerge gimp.  It's either a lib mismatch somehow or a bug in gimp.
Comment 21 Le retraité 2007-02-28 13:29:10 UTC
First thing I tried was to launch a revdep-rebuild, but no need to re-emerge gimp.
I think my new problem is a duplicate of bug 168673, since the original issue of this bug is fixed i will close it as resolved.

Thanks.
Comment 22 Philip Belemezov 2007-03-28 01:00:30 UTC
Hi!

I, naturally, had the same problem.
I can confirm that 0.7.3 fixes the problem.

Would some please mark it stable.