LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 08-28-2003, 05:20 PM   #1
StinkyFinger
LQ Newbie
 
Registered: Aug 2003
Posts: 1

Rep: Reputation: 0
Question Running script as daemon


Forgive my ignorance. I'm relatively new with Linux and had what most consider a simple question.

I'm running a web server which I start using a script I wrote...something like ./startserver.sh start. I want to run this script as a daemon so it starts up automatically w/o me logging in. i want this so if my computer goes down for whatever reason when it powers up it starts this script automatically.

i know i need to put it in /etc/rc.d/init.d but what then and how do i pass it the start command?

thanks in advance.
 
Old 08-28-2003, 06:11 PM   #2
Skyline
Senior Member
 
Registered: Jun 2003
Distribution: Debian/other
Posts: 2,104

Rep: Reputation: 45
This is a guess but ordinarily you'd create a symlink from the service in

/etc/rc.d/init.d

and put it in

/etc/rc.d/rcx.d

-were x is the run level you'd want the service to run at - once its in

/etc/rc.d/rcx.d

then rename it with Syy at the start of the name were capital S is the start signal and yy is the order number with which you want the service to start - ie some services are dependant on others already running etc etc - I must stress, this is only a guess.
 
Old 08-28-2003, 07:31 PM   #3
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
The startup script from fading memory that you put in /etc/rc.d/init.d should take a particular format , take a look at ones that are already there and modify to suit.

Instead of manually creating sym links in each rc.x directory if your script called say, my_server has something like that at the start

#chkconfig: 35 59 34
#description: description of what this is
#processname: my_server

(where 35 are the run levels you want to start, 59 goes the priority to startup and 34 for when shutting down)

You can do chkconfig --add my_server and all the sym links in the right places will be automatically created for you, hopefully
 
  


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
Problems in running a script as a daemon at startup fahad26 Programming 5 03-07-2012 07:24 AM
bash script running as daemon Satriani Programming 12 03-29-2011 05:23 PM
Running in daemon mode socks Slackware 1 10-15-2004 08:27 PM
running OpenSSL daemon Chiel Linux - Newbie 2 08-31-2004 07:59 AM
The lisa daemon does not appear to be running. Alex Housley Linux - Networking 3 10-18-2003 11:40 AM


All times are GMT -5. The time now is 10:09 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration