Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 08-28-2003, 06:20 PM   #1
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 ./ 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, 07:11 PM   #2
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


and put it in


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


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, 08:31 PM   #3
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


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

All times are GMT -5. The time now is 05:28 AM.

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