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 10-22-2000, 05:51 PM   #1
bjc
Member
 
Registered: Oct 2000
Location: NYC
Posts: 32

Rep: Reputation: 15

How do you add a daemon to the autostartup procedure?
 
Old 10-22-2000, 08:28 PM   #2
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 13,597

Rep: Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080
You are using Red Hat 6.2 if I recall correctly. You could do it the quicky way and just add a line to rc.local or you could do it the "right" way:
1) create a file in /etc/rc.d/init.d (The name is arbitrary - I usually use the program name).
Code:
#!/bin/sh
# Startup script for program
#
# description: 

# Source function library.
. /etc/rc.d/init.d/functions

[ -f /path/to/program ] || exit 0

case "$1" in
  start)
                echo -n  "Starting program" 
                /path/to/program -options
                echo
                ;;
        
  stop)
                echo -n "Shutting down program "
                killproc programname 
                echo
                ;;
        
  status)
                status programname
                ;;

  restart)
                $0 stop
                $0 start
                ;;
        
  *)
                echo "Usage: program {start|stop|restart|status}"
                exit 1

esac

exit 0
2)Make a symlink in the appropriate run level directories (usually /etc/rc.d/rc3.d) named S95filename and a symlink in /etc/rc.d/rc0.d named K50filename.
 
Old 10-23-2000, 04:28 PM   #3
bjc
Member
 
Registered: Oct 2000
Location: NYC
Posts: 32

Original Poster
Rep: Reputation: 15
Smile

thanks!
 
  


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
how do i add daemons to the startup? snip128 Debian 6 07-15-2005 09:33 AM
startup daemons? c_olin3404 Slackware 6 05-16-2005 03:21 PM
Preventing auto startup of various daemons ssmaitra Linux - Software 2 03-04-2004 11:56 PM
add windowmanager to choice list on startup ichbinesderelch Linux - General 4 08-14-2003 12:24 PM
How obtain daemons list? kokolisso Linux - Networking 1 10-07-2001 08:03 AM

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

All times are GMT -5. The time now is 05:21 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
Open Source Consulting | Domain Registration