LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 12-18-2009, 12:10 AM   #1
slash1981
LQ Newbie
 
Registered: Dec 2009
Posts: 3

Rep: Reputation: 0
Creating links to an init script.


Hi guys.

I have two questions in my homework:
1. What would you name the link to an init script that would start the fictitious bigd daemon early in the boot process?
2. What would you name the link to kill the same daemon?

I'm not asking you to answer these questions, I just want to know whether or not my answers are correct:

1. I will name the link /etc/rc.d/rcN.d/S01bigd, where N is the runlevel the system is entering.
2. I will name the link /etc/rc.d/rcN.d/K01bigd, where N is the runlevel the system is entering.

Your help would be appreciated
 
Old 12-18-2009, 06:11 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello and welcome to LinuxQuestions,

As you indicated this is homework and knowing the rules, you'll not encounter a lot of help solving it. You provided a solution to your homework. First of all you'll have to take into account that not all distros use the same structure, for example Debian (and the likes) have their init scripts in /etc/rcN.d directly. The /etc/rc.d is used for example by RedHat. Furthermore have another look at your S(tart) and K(ill) sequences remembering why they are used in that way. Those or some tips to point you in the right direction.

Kind regards,

Eric
 
Old 12-18-2009, 08:05 AM   #3
slash1981
LQ Newbie
 
Registered: Dec 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Thank you, Eric.
 
Old 12-18-2009, 01:45 PM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Good attempt

I am not familiar with all distros (and the boot scripts mechanism is one area where distros differ) but ...

The question is not well phrased because "early in the boot process" is imprecise. You answer is similarly imprecise because the booting system does not go immediately to the default run level so "the runlevel the system is entering" begs the question "Which run level".

If "early" is very early, you might want to create the startup link /etc/rc.d/rcS.d/S01bigd because run level S is entered before the default run level. But few daemons are started in run level S and few in run level <default run level> before S20; as run level S is initialised and in run level <default run level> before S~20, core Linux components are being initialised which are pre-requisites for most daemons. The default for most daemons is /etc/rc.<default run level>/S20; hence a bunch of startup script symlinks are have /etc/rc.<default run level>/S20* symlinks; hence "early" for a normal daemon would be /etc/rc<default run level>.d/~S19. Much depends on whether the daemon requires file systems to be mounted and networking to be fully initialised (initialising networking, including networked file systems, takes relatively a long time).

Regards killing the daemon, this is normally done in /etc/rc.[06].d where the kills are done in reverse order from the startups so a daemon started by /etc/rc<default run level>.d/~S99<something> is killed first with a /etc/rc.[06]/K00<something> and a daemon started by /etc/rc<default run level>.d/~S01<something> is killed first with a /etc/rc.[06]/K99<something>. This better serves any interdependencies amongst the daemons.
 
Old 12-20-2009, 06:26 PM   #5
slash1981
LQ Newbie
 
Registered: Dec 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by catkin View Post
Good attempt

I am not familiar with all distros (and the boot scripts mechanism is one area where distros differ) but ...

The question is not well phrased because "early in the boot process" is imprecise. You answer is similarly imprecise because the booting system does not go immediately to the default run level so "the runlevel the system is entering" begs the question "Which run level".
Thank you for your response.
1. Distro, I'm working with now is Fedora 8.0.
2. I believe, my instructor meant "as early as possible"

Quote:
Originally Posted by catkin View Post
If "early" is very early, you might want to create the startup link /etc/rc.d/rcS.d/S01bigd because run level S is entered before the default run level. But few daemons are started in run level S and few in run level <default run level> before S20; as run level S is initialised and in run level <default run level> before S~20, core Linux components are being initialised which are pre-requisites for most daemons. The default for most daemons is /etc/rc.<default run level>/S20; hence a bunch of startup script symlinks are have /etc/rc.<default run level>/S20* symlinks; hence "early" for a normal daemon would be /etc/rc<default run level>.d/~S19. Much depends on whether the daemon requires file systems to be mounted and networking to be fully initialised (initialising networking, including networked file systems, takes relatively a long time).

Regards killing the daemon, this is normally done in /etc/rc.[06].d where the kills are done in reverse order from the startups so a daemon started by /etc/rc<default run level>.d/~S99<something> is killed first with a /etc/rc.[06]/K00<something> and a daemon started by /etc/rc<default run level>.d/~S01<something> is killed first with a /etc/rc.[06]/K99<something>. This better serves any interdependencies amongst the daemons.
That's what I'm going to spend my break in college for. I've got books from my friends, so gonna play with it.

Anyway, thank you guys for your willing to help a newbie
 
  


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
Init script in /etc/init.d does not start at boot tdnnash25 Linux - Server 4 12-18-2009 05:40 PM
Creating hard links unixbrother Linux - Software 7 09-19-2009 06:39 AM
Creating Symbolic Links columbiasts1 Linux - Software 2 06-03-2007 12:44 PM
creating virtual links? JSkalka Linux - Newbie 2 01-17-2004 06:58 PM
creating menu's and links with c++ josh89 Programming 4 11-03-2003 07:21 PM

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

All times are GMT -5. The time now is 09:14 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