LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 07-28-2010, 10:02 AM   #1
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,697

Rep: Reputation: 48
Adding to /etc/rc.d/rc3.d


I read that if you issue the following two commands in /etc/rd.c/rc3.d that lampp will automatically restart itself when you restart a server. Could someone explain why this works? I under ln makes a link to the lampp executable, but I'm sure there's some magic behind the odd looking names of the links you're creating.

ln -s /opt/lampp/lampp S99lampp
ln -s /opt/lampp/lampp K01lampp
 
Old 07-28-2010, 10:06 AM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 613Reputation: 613Reputation: 613Reputation: 613Reputation: 613Reputation: 613
It's the System V init process.

From /etc/rc3.d/README on my Debian system:

Quote:
The scripts in this directory are executed each time the system enters
this runlevel.

The scripts are all symbolic links whose targets are located in
/etc/init.d/ .

To disable a service in this runlevel, rename its script in this directory
so that the new name begins with a 'K' and a two-digit number, where the
number is the difference between the two-digit number following the 'S'
in its current name, and 100. To re-enable the service, rename the script
back to its original name beginning with 'S'.

For a more information see /etc/init.d/README.
What happens is the rc process calls /etc/rc.d/rc3.d/S* scripts with argument "start" in order of the number in their names. Similarly K scripts are passed "stop".
 
1 members found this post helpful.
Old 07-28-2010, 10:09 AM   #3
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
/etc/rc.d/rcX.d directory contain scripts which are execute at boot time or at runlevel changing.

if script name start with S it means script/service start at boot time.
if script name start with K it means script/service stop/kill at boot time.

if you want to start lampp service in runlevel 3 then create link with S

HTH
 
1 members found this post helpful.
Old 07-28-2010, 10:11 AM   #4
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,697

Original Poster
Rep: Reputation: 48
OK, I understand the S ones now. But does it call the K ones during a shutdown, and that's why you create them also?
 
Old 07-28-2010, 10:12 AM   #5
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,697

Original Poster
Rep: Reputation: 48
Thanks sem007, you answered the question in my post when I was replying to Alucard. K's are called during shutdown. Makes sense, and I understand the reason behind the numbering pattern too, pretty clever!
 
Old 07-28-2010, 10:17 AM   #6
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
K script execute at shutdown or when you change run level.

for just an example if you set postfix link K100postfix in runlevel3 and when you switch any runlevel to runlevel 3 it means postfix service stopd.

when you shutdown or restart system scripts of /etc/rc.d/rc0.d will execute and all script links (exclude killall and halt) start with K

you can compare it yourself

Code:
ls -l /etc/rc.d/rc3.d
ls -l /etc/rc.d/rc0.d
HTH
 
  


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
rc3 runlevel 3 PMP Linux - Newbie 5 07-29-2009 03:04 PM
Slackware 12.1 RC3:-) hitest Slackware 18 05-01-2008 10:43 PM
Ndiswrapper v1.0 RC3 available snecklifter Linux - Wireless Networking 6 01-19-2005 06:46 PM
Mandrake 9.1 RC3 onurb Linux - Software 13 03-25-2003 03:44 PM
Slackware 8.1 rc3 charliekennedy Slackware 3 06-16-2002 02:38 PM

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

All times are GMT -5. The time now is 06:48 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration