LinuxQuestions.org
Help answer threads with 0 replies.
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 05-22-2001, 11:23 AM   #1
Raygun
LQ Newbie
 
Registered: Apr 2001
Location: Georgia, USA
Posts: 12

Rep: Reputation: 0
Question


To start my dynipclient executable I have to start it in a terminal console. Usually by ./dynipclient.
How would get it to run when I start up Mandrake 8?
I would like to autostart similar to windows.

Any suggestions?
 
Old 05-22-2001, 12:03 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,361
Blog Entries: 55

Rep: Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547
The ideal way would be to use runlevel scripts.
Put script as /etc/rc.d/init.d/runDynip & make executable.
now on the commandline link it to the runlevel u start in (say 3):
ln -s /etc/rc.d/init.d/runDynip /etc/rc.d/rc3.d/SrunDynip
or in X use mandrake's Sysv Init editor.

#cut below & replace underscores to spaces
#!/bin/sh
#set location of the app to run or else well
# have to find it ourselves...
#APP=/usr/local/bin/dynipclient
APP=$(whereis dynipclient | gawk '{print $2}')

if [ -f /etc/rc.d/init.d/functions ]; then
# Dont know if Meandork uses functions :-]
____. /etc/rc.d/init.d/functions
____USEF=1
else
# Just make sure were not off some path
____P=$(whereis pidof | gawk '{print $2}')
____K=$(whereis kill | gawk '{print $2}')
____USEF=0
fi

case "$1" in
___start)
________if [ $USEF = 1 ]; then
________daemon $APP
________else
________nohup $APP &
________fi
________echo "DynIP Client started"
________;;
____stop)
________if [ $USEF = 1 ]; then
________killproc $APP
________else
________# or kill -s TERM $(pidof dynipclient)
________$K -s TERM $($P $APP)
________fi
________echo "DynIP Client stopped"
________;;
_______*)
________echo "runDynip [start|stop]"
________exit 1
esac

exit 0
#cut above

now itll run on startup or u can run it like (path to)RunDynip start/stop

*btw, be carefull with scripts u didnt write ureself
 
Old 05-22-2001, 12:30 PM   #3
Raygun
LQ Newbie
 
Registered: Apr 2001
Location: Georgia, USA
Posts: 12

Original Poster
Rep: Reputation: 0
Question

unSpawn,
Thanks for the help.
Can you make your instructions a little simpler?
I am not very knowledgable with scripts.
Thanks
 
Old 05-22-2001, 02:37 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,361
Blog Entries: 55

Rep: Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547
argh. and I thought I made it easy :-]

ok. copy everything between the marks "cut below" and "cut above" to a file named RunDynip. open your favourite editor and replace the underscores with spaces, or open an xterm window, locate the file RunDynip. All commands below should be run without quoting and each on its own line!
This will replace the underscores, copy, make executable, and link to the default runlevel u start in.

"cat RunDynip | sed -e "s/_/ /g" > RunDynip"
"cp RunDynip /etc/rc.d/init.d/runDynip"
"chmod 0750 /etc/rc.d/init.d/runDynip"
"cat /etc/inittab | grep initdefault | sed -e "s/:/ /g" | gawk '{print $2}'"
now take note from the number it just printed, u will insert it in the place of the # in the line below:
"ln -s /etc/rc.d/init.d/runDynip /etc/rc.d/rc#.d/SrunDynip"

 
  


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 Java executable class from another executable class LUB997 Programming 22 07-24-2005 05:57 AM
autostart noobtesting Mandriva 3 07-04-2004 12:45 PM
Autostart wampfler Fedora 2 01-01-2004 03:18 PM
Autostart Haiyadragon Mandriva 4 12-26-2003 07:35 AM
Autostart for an Executable Raygun Linux - General 3 05-14-2001 07:28 AM

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

All times are GMT -5. The time now is 12:15 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration