Linux - Newbie This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
02-02-2005, 03:04 PM
|
#1
|
Member
Registered: May 2004
Location: Terre Haute IN
Distribution: FC6/7 Suse 10.2
Posts: 41
Rep:
|
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".
Thanks, Andy.
|
|
|
02-02-2005, 03:08 PM
|
#2
|
Member
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827
Rep:
|
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
Last edited by Artanicus; 02-02-2005 at 03:12 PM.
|
|
|
02-02-2005, 03:27 PM
|
#3
|
Member
Registered: May 2004
Location: Terre Haute IN
Distribution: FC6/7 Suse 10.2
Posts: 41
Original Poster
Rep:
|
Thanks, if i run
[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?
|
|
|
02-02-2005, 03:30 PM
|
#4
|
Senior Member
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973
Rep:
|
do you have /usr/lib/powerchute in your PATH?
as root:
ln -s /usr/lib/powerchute/xpowerchute /usr/bin/xpowerchute and see if that helps
or
export PATH=$PATH:/usr/lib/powerchute
note that the second solution will need to be added to your .bashrc or /etc/bashrc or /etc/profile for it to be permanent
Last edited by __J; 02-02-2005 at 03:32 PM.
|
|
|
02-02-2005, 03:33 PM
|
#5
|
Member
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827
Rep:
|
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
Last edited by Artanicus; 02-02-2005 at 03:34 PM.
|
|
|
02-02-2005, 03:38 PM
|
#6
|
Senior Member
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973
Rep:
|
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....
|
|
|
02-02-2005, 03:40 PM
|
#7
|
Member
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827
Rep:
|
Quote:
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
|
|
|
02-02-2005, 03:43 PM
|
#8
|
Senior Member
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973
Rep:
|
oops, forgot the whole path was put in the command box
|
|
|
02-02-2005, 03:48 PM
|
#9
|
Member
Registered: May 2004
Location: Terre Haute IN
Distribution: FC6/7 Suse 10.2
Posts: 41
Original Poster
Rep:
|
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
|
|
|
|
02-02-2005, 03:50 PM
|
#10
|
Senior Member
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973
Rep:
|
did you make the script executable?
|
|
|
02-02-2005, 03:51 PM
|
#11
|
Member
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827
Rep:
|
sure sounds like it needs to be run as root.. Well, if yore willing to settle for a bubblegum solution, lets modify the script abit.. (;
Code:
#!/bin/bash
su -c "cd /usr/lib/powerchute && ./xpowerchute"
exit 0
And set the box to run it in a console.. Then itll ask you for your password, and then execute it as root.. Worth a try.. (:
|
|
|
02-02-2005, 03:56 PM
|
#12
|
Member
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827
Rep:
|
oh yeah, and as mr J said,
Code:
chmod +x powerchute.sh
helps the process alot.. The talk about child process led me to think the wrong way.. (:
|
|
|
02-02-2005, 07:18 PM
|
#13
|
Member
Registered: May 2004
Location: Terre Haute IN
Distribution: FC6/7 Suse 10.2
Posts: 41
Original Poster
Rep:
|
Setting the permissions below did the trick on the link, thanks for the help. I learned quite a bit with all the help!
Andy
Quote:
Originally posted by Artanicus
oh yeah, and as mr J said,
Code:
chmod +x powerchute.sh
helps the process alot.. The talk about child process led me to think the wrong way.. (:
|
|
|
|
All times are GMT -5. The time now is 05:52 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|