xfrun4 ("Run application" dialog) does not use PATH to run application

Bug #306331 reported by RomanIvanov
8
Affects Status Importance Assigned to Milestone
Xfce4 Utilities
Invalid
Unknown
xfce4-utils (Ubuntu)
Won't Fix
Medium
Unassigned

Bug Description

XUbuntu 8.10. I have Eclipse installed(unzipped) under my home folder (/home/romani/java/Eclipse34/eclipse).
I add this folder to .bashrc file
"
export PATH=$PATH:/home/romani/java/Eclipse34/eclipse
"

Press Alt+F2 and type "eclipse", press Enter -> Error message that such file does not exist.

To check correctness of PATH - open terminal and type "eclipse" ->Eclipse is launching.

Revision history for this message
Charlie Kravetz (cjkgeek) wrote :

Did you log out and log back in? .bashrc does not restart by itself, to the best of my knowledge.

Revision history for this message
RomanIvanov (ivanov-jr) wrote :

yes I did it, I lived with this problem for weeks, and did workaround by making link and placing it /usr/bin folder. Doe you have problem with reproducing the bug? Feel free to connect me for this issue it is still pain a bit.

Revision history for this message
Charlie Kravetz (cjkgeek) wrote :

I can confirm this bug. If you open a terminal and type "set >> ~/Desktop/set_text.txt" , a file is created that contains all the items in SET. PATH= will be included in this text file.
/home/charlie
If you use Alt+F2 instead to run the same command, it will give you an error message :
The command "set >> ~/Desktop/set_text.txt" failed to run:
Failed to execute child process "set" (No such file or directory)

If "Run in terminal" is checked in the run Program box, a terminal window will open, no error will appear, and no prompt will appear in the terminal.

It appears that Alt+F2 (Run Program) does not see the .bashrc file, and may not use bash/dash at all.

Revision history for this message
GeekSmith (lixo-geeksmith) wrote :

In xfrun-dialog.c, it's passing a NULL envp argument to xfce_gdk_spawn_on_screen(). Why not grab the user's path, or even the entire user environment, and pass it in here? Seems like this would solve it pretty quick.

Revision history for this message
Charlie Kravetz (cjkgeek) wrote :

GeekSmith: Can you write a patch for that? I am neither a developer or programmer. If it is simple, can you help fix this issue? That would be great, and I am sure the developers would appreciate the help. Thanks. Just attach the patch using 'add attachment or patch' under the comments box.

Revision history for this message
GeekSmith (lixo-geeksmith) wrote :

Will do when I get a chance next week.

Revision history for this message
GeekSmith (lixo-geeksmith) wrote :

This patch should grab the user's PATH from the environment and send it up the chain. The user will need to make sure that PATH is set properly and available to xfrun.

tags: added: patch xubuntu
Revision history for this message
Lionel Le Folgoc (mrpouit) wrote :

Please forward this patch upstream. Thanks!

Revision history for this message
Charlie Kravetz (cjkgeek) wrote :

Thank you for the patch. This bug and patch has been reported to the developers of the software. You can track it and make comments at: http://bugzilla.xfce.org/show_bug.cgi?id=6362

Revision history for this message
Charlie Kravetz (cjkgeek) wrote :

Response from Xfce developers on this bug:

 Brian J. Tarricone editbugs 2010-04-03 09:15:09 UTC

No bug here. NULL in envp means "use the current environment." Likely xfrun4
is getting started by dbus-daemon, which is getting started before the user's
PATH is getting set up. Or, more likely, ~/.bashrc isn't sourced by Xfce's
init script. You'll need to get the directory in PATH via some other means.

Revision history for this message
GeekSmith (lixo-geeksmith) wrote :

OK, my bad. One standard thing I do on my machines is add the following line near the top of /etc/profile:
PATH=~/bin:$PATH

And that puts everything I want in my path. This may also be accomplished by putting this line in ~/.profile, depending on your shell.

Setting this in .bashrc does not work because login shells don't read rc files, they read profile files. See http://en.wikipedia.org/wiki/Unix_shell#Configuration_files_for_shells

I suggest the user try setting PATH in a profile file instead of an rc file.

David Futcher (bobbo)
tags: added: patch-rejected-upstream
removed: patch
Changed in xfce4-utils:
status: Unknown → Invalid
Revision history for this message
Lionel Le Folgoc (mrpouit) wrote :

Marked as invalid upstream, so we won't introduce any delta for that (moreover there's an easy workaround).

Changed in xfce4-utils (Ubuntu):
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.