LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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-17-2007, 02:21 PM   #1
rogueeve
LQ Newbie
 
Registered: Oct 2006
Posts: 11

Rep: Reputation: 0
Add an init script?


Here's an easy one: what's the right way to add an init script under /etc/rc.d/init.d (Fedora)? I assumed Fedora just enumerated and ran every file in that directory at bootup but it does not appear to work that way. I got my scripts to run by hijacking the bluetooth one to call them but obviously this isn't the Right Way.
 
Old 05-17-2007, 02:53 PM   #2
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,499
Blog Entries: 2

Rep: Reputation: 68
If the script is in /etc/init.d and it's header follows a LSB convention for this, it can be set to start at boot time at the pre-defined run-levels, by running "chkconfig name-of-init-script on" (or off). Check chkconfig man page for other options.

chkconfig will read the following header of init script to figure out what run-levels it should run and what are the dependencies for other services. For example, the festival init script has the following header:
Code:
### BEGIN INIT INFO
# Provides:          festival
# Required-Start:    $syslog $remote_fs
# Should-Start:      $time
# Required-Stop:     $syslog $remote_fs
# Should-Stop:       $time
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Short-Description: festival daemon providing full text-to-speech system
# Description:       Start festival to allow applications to access a
#       text-to-speech system with various APIs, as well as an environment
#       for development and research of speech synthesis techniques. It is
#       written in C++ and has a Scheme-based command interpreter for
#       general control. 
### END INIT INFO
chkconfig will create or remove the right links at /etc/init.d/rc[0123456S].d as needed.
 
  


Reply



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 to write init script shahrokhnikou Programming 4 10-24-2005 03:08 PM
add a static route in Network init files Ghitza Linux - Networking 1 11-19-2004 05:26 AM
how do i add my script in init nukeu666 Linux - Newbie 1 08-16-2004 07:56 AM
How to add something in init script Ypkis Linux - Newbie 5 10-12-2003 06:35 AM
could use some help with my init.d script.... BrianK Linux - General 3 10-31-2002 07:21 PM

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

All times are GMT -5. The time now is 04:56 PM.

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