Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 158469 - x11-libs/gksu desktop file which tries to launch a non-existant executable
Summary: x11-libs/gksu desktop file which tries to launch a non-existant executable
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High trivial (vote)
Assignee: Daniel Gryniewicz (RETIRED)
URL:
Whiteboard:
Keywords:
: 164451 223251 254213 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-12-18 09:20 UTC by Travis Hansen
Modified: 2009-01-11 13:57 UTC (History)
5 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 Travis Hansen 2006-12-18 09:20:00 UTC
If you install gksu, you will get a "Root Terminal" menu item inside of Accessories.  It attempts to use gksu to launch a terminal, but the executable it tries to launch is `x-terminal-emulator`.  It looks like debian creates some symlinks or something for this.  It might be good to patch it to use gnome-terminal?
Comment 1 Daniel Gryniewicz (RETIRED) gentoo-dev 2006-12-20 13:03:19 UTC
Just an update on this bug:

I tried to do this, and discovered that arm has no keywords for any gnome-terminal.  This makes it a bit hard to depend on it...

My current thought is that I'll stop installing that misleading desktop file.  I'm open to alternative suggestions.
Comment 2 Travis Hansen 2006-12-20 13:09:51 UTC
yeah, this kinda a tough one, the only way I can think of is kinda a headache...creating some sort of eselect module for it.  Or maybe just change the default to xterm and let people change it manually if they want.
Comment 3 subs 2006-12-20 19:05:16 UTC
Why doesn't it respect the gnome preferred application's terminal as discussed here:

http://forums.gentoo.org/viewtopic-t-524578.html
Comment 4 Travis Hansen 2006-12-21 07:16:17 UTC
Yeah, I was just thinking about this.  One idea, is to change the Exec line of the .desktop file and remove the gksu.  Then create an x-terminal-emulator shell script that reads the gconf keys for the user and launches that with the gksu command.


TERMINAL_APP=$(gconftool-2 --get "/desktop/gnome/applications/terminal/exec")

$(gksu ${TERMINAL_APP})

Seems fairly simple, and we already dep on gconf.  But there could be other issues that haven't crossed my mind.
Comment 5 Daniel Gryniewicz (RETIRED) gentoo-dev 2007-01-03 19:38:50 UTC
It's possible.  I'll look into what debian does, when I get a chance.  The issue is what to do if that is set to gnome-terminal, but it's not installed, for example.  There's no reason why the program in that setting should be installed, unless we've depped on it.
Comment 6 Daniel Gryniewicz (RETIRED) gentoo-dev 2007-01-30 18:51:46 UTC
*** Bug 164451 has been marked as a duplicate of this bug. ***
Comment 7 Daniel Gryniewicz (RETIRED) gentoo-dev 2007-01-30 20:14:20 UTC
Okay, so Debian has some complex system for terminal emulators to register themselves at various priorities.  That's not something I want to maintain.  At this point, I see only a couple of possiblities: add a dep on gnome-terminal under the gnome USE flag, and arm and sh have to deal; Remove the desktop file entirely (I don't like this option, it's a useful thing to have); Move the desktop file to some other package that deps on gksu, say gnome-terminal.

Anyone else come up with any possibilites?  Keep in mind, and program we run *must* be depped on.
Comment 8 Travis Hansen 2007-01-30 20:44:21 UTC
I've created a script file

'''
#!/bin/bash

TERMINAL_APP=$(gconftool-2 --get "/desktop/gnome/applications/terminal/exec")

TERMINAL_APP_EXEC_ARG=$(gconftool-2 --get "/desktop/gnome/applications/terminal/exec_arg")

$(gksu ${TERMINAL_APP})

exit 0

'''

and saved this bad boy in /usr/sbin/<whatever you want>


Then I changed the .desktop file to launch the script (without gksu cause it gets called in the script) and I'm happy.
Comment 9 Daniel Gryniewicz (RETIRED) gentoo-dev 2007-01-30 21:22:37 UTC
That's no good.  We have to know what that script is calling, and ensure it's installed via a dep.
Comment 10 Gilles Dartiguelongue (RETIRED) gentoo-dev 2008-03-29 12:26:19 UTC
(In reply to comment #9)
> That's no good.  We have to know what that script is calling, and ensure it's
> installed via a dep.
> 

well it doesn't work at all currently and if we do that, then the user might just be pointed to how to change the setting in gconf like what evolution ebuild does for non-gnome users. @herd, what do you think ?
Comment 11 Otávio Cipriani 2008-05-23 18:35:26 UTC
(In reply to comment #0)
> If you install gksu, you will get a "Root Terminal" menu item inside of
> Accessories.  It attempts to use gksu to launch a terminal, but the executable
> it tries to launch is `x-terminal-emulator`.  It looks like debian creates some
> symlinks or something for this.  It might be good to patch it to use
> gnome-terminal?
> 

Easy workaround "ln -s /usr/bin/gnome-terminal /usr/bin/x-terminal-emulator"
Comment 12 Arun Raghavan (RETIRED) gentoo-dev 2008-05-23 21:25:58 UTC
(In reply to comment #10)
> (In reply to comment #9)
> > That's no good.  We have to know what that script is calling, and ensure it's
> > installed via a dep.
> > 
> 
> well it doesn't work at all currently and if we do that, then the user might
> just be pointed to how to change the setting in gconf like what evolution
> ebuild does for non-gnome users. @herd, what do you think ?

The message idea sounds good. In addition to this, how about:

x-terminal-emulator can be a little package that does the gconf magic, and if that program doesn't exist, fires up gnome-terminal. If gnome-terminal doesn't exist, it displays a message like the one in the ebuild (it can also use zenity to throw the popup up if it's present).

I can hack up this x-terminal-emulator if it sounds okay. Also, x-terminal-emultaor is probably wrong nomenclature if we want to use gconf/gnome-terminal as the default. g-terminal-emulator or something like that probably makes more sense. :)
Comment 13 Gilles Dartiguelongue (RETIRED) gentoo-dev 2008-05-23 23:10:29 UTC
*** Bug 223251 has been marked as a duplicate of this bug. ***
Comment 14 Daniel Gryniewicz (RETIRED) gentoo-dev 2008-05-24 16:20:11 UTC
Okay, I've just taken the simple out for this.  If USE gnome, then the .desktop will refer to gnome-terminal, and there's a dep.  If ! USE gnome, then the .desktop isn't installed at all.  If someone is willing to knock up a good script to do this (preferably with eselect) I'm more than willing to take it.
Comment 15 Otávio Cipriani 2008-05-24 17:36:50 UTC
(In reply to comment #14)
> Okay, I've just taken the simple out for this.  If USE gnome, then the .desktop
> will refer to gnome-terminal, and there's a dep.  If ! USE gnome, then the
> .desktop isn't installed at all.  If someone is willing to knock up a good
> script to do this (preferably with eselect) I'm more than willing to take it.

May I suggest that the Icon in the ".desktop" be changed to "gnome-terminal"? It is much better looking than the default one.
Comment 16 Daniel Gryniewicz (RETIRED) gentoo-dev 2008-05-25 03:04:33 UTC
I agree it looks better, but it's probably a good thing that the root terminal icon looks different, so I'll leave it for now.
Comment 17 Louis Frayser 2008-10-03 01:02:23 UTC
gksu-2.0.0-r1:

Gnome-terminal's default profile (for root) determines what it does when gksu opens it.  On my system this default profile starts a shell as an unprivilaged user, thus defeating the whole purpose of gksu.  

Not knowing what root's default profile would do, it's possibly incorrect for gksu to invoke gnome-terminal--unless there's some way of disabling the profile mechanism. I wish gnome-terminal had a "--no-default-profile" option, but couldn't find anything like that.

gksu "/usr/bin/gnome-terminal -e su - " gives the desired result; but that's so redundant.
Comment 18 Rémi Cardona (RETIRED) gentoo-dev 2009-01-08 16:48:17 UTC
*** Bug 254213 has been marked as a duplicate of this bug. ***
Comment 19 denis 2009-01-08 20:18:12 UTC
(In reply to comment #17)
> gksu-2.0.0-r1:
> 
> Gnome-terminal's default profile (for root) determines what it does when gksu
> opens it.  On my system this default profile starts a shell as an unprivilaged
> user, thus defeating the whole purpose of gksu.  
> 
> Not knowing what root's default profile would do, it's possibly incorrect for
> gksu to invoke gnome-terminal--unless there's some way of disabling the profile
> mechanism. I wish gnome-terminal had a "--no-default-profile" option, but
> couldn't find anything like that.
> 
> gksu "/usr/bin/gnome-terminal -e su - " gives the desired result; but that's so
> redundant.
> 

This (gksu "/usr/bin/gnome-terminal -e su - ") does NOT give me the desired / expected result. 

$ gksu "/usr/bin/gnome-terminal -e su - "
Xlib:  extension "RANDR" missing on display "127.0.0.1:2.0".
Xlib: connection to "127.0.0.1:2.0" refused by server
Xlib: Client is not authorized to connect to Server
Cannot open display: 
Run '/usr/bin/gnome-terminal --help' to see a full list of available command line options.
Comment 20 Louis Frayser 2009-01-10 08:03:57 UTC
> (In reply to comment #17)
> > gksu-2.0.0-r1:
> > 
> $ gksu "/usr/bin/gnome-terminal -e su - "
> Xlib:  extension "RANDR" missing on display "127.0.0.1:2.0".
> Xlib: connection to "127.0.0.1:2.0" refused by server
> Xlib: Client is not authorized to connect to Server
> Cannot open display: 

The display tried was ":2.0" and there was an authorization problem connecting to it.  

Is this is a case of logging in to a remote system from X running on another system?  The display is usually ":0.0" when running locally?  If this is a remote session, then some combination of the xhost command and use of the DISPLAY environment variable should help.  Something similar may arise from having multiple X servers on the local host.

Also, running  gksu "/usr/bin/gnome-terminal -e su" without the final hyphen, avoiding a new session and preserving the DISPLAY variable, might help; the resulting environment (PATH, etc.) in gnome-terminal would be mostly the user's instead of root's.




Comment 21 denis 2009-01-11 13:57:23 UTC
(In reply to comment #20)
> > (In reply to comment #17)
> > > gksu-2.0.0-r1:
> > > 
> > $ gksu "/usr/bin/gnome-terminal -e su - "
> > Xlib:  extension "RANDR" missing on display "127.0.0.1:2.0".
> > Xlib: connection to "127.0.0.1:2.0" refused by server
> > Xlib: Client is not authorized to connect to Server
> > Cannot open display: 
> 
> The display tried was ":2.0" and there was an authorization problem connecting
> to it.  
> 
> Is this is a case of logging in to a remote system from X running on another
> system?  The display is usually ":0.0" when running locally?  If this is a
> remote session, then some combination of the xhost command and use of the
> DISPLAY environment variable should help.  Something similar may arise from
> having multiple X servers on the local host.
> 
> Also, running  gksu "/usr/bin/gnome-terminal -e su" without the final hyphen,
> avoiding a new session and preserving the DISPLAY variable, might help; the
> resulting environment (PATH, etc.) in gnome-terminal would be mostly the user's
> instead of root's.
> 

The display number is correct: my client connects to Xvnc server session running on remote server.

Running command gksu "/usr/bin/gnome-terminal -e su" without the final hyphen as you suggested does bring up the terminal, as wanted.
There are warning messages, but they don't mattter to me as long as I get result.
Thank you.

$ gksu "/usr/bin/gnome-terminal -e su"
Xlib:  extension "RANDR" missing on display "127.0.0.1:2.0".
Xlib:  extension "RANDR" missing on display "127.0.0.1:2.0".

(gnome-terminal:31256): GnomeUI-WARNING **: While connecting to session manager:
Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed.