Can only start program from console, link doesn't work.
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Can only start program from console, link doesn't work.
I am trying to create a link in Gnome to start the APC Powerchute application. If I start it from the console I have no problems:
[root@WindozeSucks ~]# cd /usr/lib/powerchute
[root@WindozeSucks powerchute]# ./xpowerchute
This works perfectly.
But if I create a link in Gnome, and add the text "/usr/lib/powerchute/xpowerchute" in the "Command:" box the application seems like it is going to start, ie the expanding boxes, then nothing! I have also tried the "Run in terminal" check box with no luck either. Any other variation results in an error that says "No such File or Dectory".
what happens if you set the link / run application to run:
Code:
cd /usr/lib/powerchute && ./xpowerchute
maybe it just needs to "be in the right path"?
Another scenario is, does it need to be run as root? in your console example you run it as root, as in your buttons you most likely run it as a normal user..
if you need it to run as root, you could use a utility like kdesu or similar to achieve the run as root.. I aint that familiar with gnome
[root@WindozeSucks powerchute]# cd /usr/lib/powerchute && ./xpowerchute
No problems.
If I put "cd /usr/lib/powerchute && ./xpowerchute" into the command: box of the link launcher I receive "Details: Failed to execute child process "cd" (No such file or directory).
If I try "/usr/lib/powerchute && ./xpowerchute" in the command: box I receive "Details: Failed to execute child process "/usr/lib/powerchute" (Permission denied)".
Maybe you are correct about the user rights of the Gnome launcher?
mm.. seems like the gnome run thingy aint as smart as kde:s.. Soo, the easiest way to fix it would prolly be to create a simple shellscript and then run that with the button.. like this /home/user/scripts/powerchute.sh which would have the following in it:
Code:
#!/bin/bash
cd /usr/lib/powerchute
./xpowerchute
exit 0
That would fix the possible error situation what stupid apps run accross when they think they will allway be run as ./ instead of a full path..
As for the running as root, kde:s "icons" and menu-editor have an option to run the thing as a different user, maybe gnome has something dimilar? assuming you actually need to run it as root
Originally posted by __J it wouldn't work in kde/gnome/anything if /usr/lib/powerchute is not set in PATH. All it will do is silently fail with a command not found....
imho PATH only matters when running it without the full path. If we use a full path when running and the target is executable, there should be no problem in a normal system.. If the problem was that it wouldnt run when typing "xpowerchute", then it would be related to PATH
Thanks for the reply, that sure did sound good, but I received the same "Details: Failed to execute child process "/home/powerchute.sh" (Permission denied)"
Thanks, Andy
Quote:
Originally posted by Artanicus mm.. seems like the gnome run thingy aint as smart as kde:s.. Soo, the easiest way to fix it would prolly be to create a simple shellscript and then run that with the button.. like this /home/user/scripts/powerchute.sh which would have the following in it:
Code:
#!/bin/bash
cd /usr/lib/powerchute
./xpowerchute
exit 0
That would fix the possible error situation what stupid apps run accross when they think they will allway be run as ./ instead of a full path..
As for the running as root, kde:s "icons" and menu-editor have an option to run the thing as a different user, maybe gnome has something dimilar? assuming you actually need to run it as root
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.