Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 31st October 2005, 07:12 AM
tfindlay Offline
Registered User
 
Join Date: Jun 2005
Posts: 72
KDE desktop 'Link to application' /w parameters ?

Hi,

I'm trying to knock up some icons to do various tasks for me like starting/stopping some special services and stuff...

So I created a "Link to application" and under the command I put in "Myscript.sh start" I put in the correct path where Myscript.sh lives and it comes back:
Command 'Myscript.sh start' not found

I tried quoting the string, but no joy! ... Surely this should be pretty easy ? I dont want to end up with special start & stop scripts, I want to be able to handle all those functions in the one script.

Any ideas ?
Reply With Quote
  #2  
Old 31st October 2005, 09:01 AM
RedFedora's Avatar
RedFedora Offline
Registered User
 
Join Date: May 2004
Posts: 503
Hmm, is the script file executable. That is, when you run it from
the command line, does it work?

What language is the script in? Does it use bash? tcsh? You might
try using:
/bin/bash /path/to/script start

I forget if you need quotes around the whole string or not.
__________________
Registered Linux User # 373325
Reply With Quote
  #3  
Old 31st October 2005, 04:24 PM
sailor's Avatar
sailor Offline
Registered User
 
Join Date: Mar 2004
Location: San Antonio, Texas
Age: 55
Posts: 3,996
when making links you have the option to "run in terminal"
__________________
sailor
Fedora 16, Mac OSX Snow Leopard, Windows 7
Registered linux user #362635
****************************************
Reply With Quote
  #4  
Old 31st October 2005, 04:25 PM
sailor's Avatar
sailor Offline
Registered User
 
Join Date: Mar 2004
Location: San Antonio, Texas
Age: 55
Posts: 3,996
when making links you have the option to "run in terminal"
for a script you would have to check that option.
__________________
sailor
Fedora 16, Mac OSX Snow Leopard, Windows 7
Registered linux user #362635
****************************************
Reply With Quote
  #5  
Old 8th November 2005, 09:51 AM
tfindlay Offline
Registered User
 
Join Date: Jun 2005
Posts: 72
Thanks folks,

I checked the permissions and they seem ok, I also ticked the "run in terminal" checkbox. I've since hacked up the shell script I'm trying to run (which was generated by the installation of the package) and found it DOES execute, but it seems the script loops back and calls itself like so:

$0 start2 &

This is the bit that doesnt seem to run
The full script looks something like:
#!/bin/sh
#
# Variables Used:
# $USER_MAGIC_FOLDER_2$ = /usr/local/appserver/config/Main
# $MYROOT$ = /usr/local/appserver/config
# $OMAPORT$ = 8561

DIR=/usr/local/appserver/config/Main/MyServer
MYCMD=/usr/local/appserver/config/myapp
PORT=8561
SERVERUSER=user

# Are we super user
if id | grep "^uid=0(" >/dev/null 2>&1 ; then
root=1
else
root=0
fi

# See how we were called

case "$1" in
start)
if [ -f $DIR/server.pid ]; then
pid=`cat $DIR/server.pid`
kill -0 $pid
if [ $? -eq 0 ]; then
echo "Server (pid $pid) is already running..."
exit 0
fi
rm $DIR/server.pid
fi
$0 start2 &
;;
start2)
cd $DIR/..
if [ $root -eq 1 ]; then
su - $SERVERUSER -c "cd $DIR/..; $MYCMD -log $DIR/logs/Server_%Y.%m.%d.log -noautoexec -memsize MAX -netencralg \"proprietary\" -pagesize MAX -linesize MAX -user $DIR/user -logparm \"rollover=auto open=replaceold write=immediate\" -noterminal -objectserver -objectserverparms \"cel=credentials protocol=bridge port=$PORT &
else
nohup $MYCMD -log $DIR/logs/Server_%Y.%m.%d.log -noautoexec -memsize MAX -netencralg "proprietary" -pagesize MAX -linesize MAX -sasuser $DIR/user -logparm "rollover=auto open=replaceold write=immediate" -noterminal 2>&1 &
fi
pid=$!
echo $pid > $DIR/server.pid
echo "Server (pid $pid) is running..."
# Trap signals 9 and 15 and pass on to child process
trap 'kill $pid' 2 3 15
wait $!
rm "$DIR/server.pid"
echo "Server is stopped"
;;
stop)
if [ -f $DIR/server.pid ]; then
kill `cat $DIR/server.pid`
else
echo "Server is stopped"
exit 1
fi
;;
status)
if [ -f $DIR/server.pid ]; then
pid=`cat $DIR/server.pid`
kill -0 $pid
if [ $? -eq 0 ]; then
echo "Server (pid $pid) is running..."
fi
else
echo "Server is stopped"
fi
;;
restart)
$0 stop
if [ $? -eq 0 ]; then
sleep 5
$0 start
fi
;;
*)
echo "Usage Server {start|stop|status|restart}"
exit 1
esac


Any idea why this line doesnt work ? if I remove the & it seems to start ok, but the child process then holds the parent up.
Reply With Quote
Reply

Tags
application, desktop, kde, link, or w, parameters

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to link the shared libraires to my application Bindu Guides & Solutions (No Questions) 0 26th October 2006 05:40 PM
Desktop to workstation application? slopoke_iii Installation and Live Media 4 25th January 2006 06:28 PM
Creating Application Link Python/Perl darthn Using Fedora 6 28th December 2005 06:50 PM
make a symbolic link file with parameters jiawj Using Fedora 6 3rd November 2004 07:47 AM


Current GMT-time: 14:09 (Sunday, 19-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat