LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 02-02-2005, 03:04 PM   #1
longblock454
Member
 
Registered: May 2004
Location: Terre Haute IN
Distribution: FC6/7 Suse 10.2
Posts: 41

Rep: Reputation: 15
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.
 
Old 02-02-2005, 03:08 PM   #2
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Rep: Reputation: 31
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.
 
Old 02-02-2005, 03:27 PM   #3
longblock454
Member
 
Registered: May 2004
Location: Terre Haute IN
Distribution: FC6/7 Suse 10.2
Posts: 41

Original Poster
Rep: Reputation: 15
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?
 
Old 02-02-2005, 03:30 PM   #4
__J
Senior Member
 
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973

Rep: Reputation: 46
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.
 
Old 02-02-2005, 03:33 PM   #5
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Rep: Reputation: 31
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.
 
Old 02-02-2005, 03:38 PM   #6
__J
Senior Member
 
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973

Rep: Reputation: 46
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....
 
Old 02-02-2005, 03:40 PM   #7
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Rep: Reputation: 31
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
 
Old 02-02-2005, 03:43 PM   #8
__J
Senior Member
 
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973

Rep: Reputation: 46
oops, forgot the whole path was put in the command box
 
Old 02-02-2005, 03:48 PM   #9
longblock454
Member
 
Registered: May 2004
Location: Terre Haute IN
Distribution: FC6/7 Suse 10.2
Posts: 41

Original Poster
Rep: Reputation: 15
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
 
Old 02-02-2005, 03:50 PM   #10
__J
Senior Member
 
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973

Rep: Reputation: 46
did you make the script executable?
 
Old 02-02-2005, 03:51 PM   #11
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Rep: Reputation: 31
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.. (:
 
Old 02-02-2005, 03:56 PM   #12
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Rep: Reputation: 31
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.. (:
 
Old 02-02-2005, 07:18 PM   #13
longblock454
Member
 
Registered: May 2004
Location: Terre Haute IN
Distribution: FC6/7 Suse 10.2
Posts: 41

Original Poster
Rep: Reputation: 15
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.. (:
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Running a program link from Desktop paul85 Linux - Newbie 4 08-02-2005 05:40 AM
how to create a link of a program ? anindyanuri Linux - Software 7 06-19-2005 01:11 PM
Link to good console fonts ? iZvi Slackware 2 12-05-2004 01:02 PM
Can't start program using X in root console! nyk Linux - Software 7 02-10-2004 06:46 PM
Cant Compile(link) a C Threaded program tristan_vdv Programming 2 05-30-2002 05:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration