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 11-07-2011, 11:24 PM   #1
jhonnappier2007
LQ Newbie
 
Registered: Nov 2011
Posts: 17

Rep: Reputation: Disabled
Question Scripts starting with K in /etc/rc#.d/


Hi all,

I have a question, What is the purpose of the scripts starting with K in the /etc/rc#.d/ where # is the respective mode(1,2,3,4etc)

Does the links starting in K is kills the running scripts or it runs a script to kill the process?

Please forgive me if my question is stupid.

Thanks in advance.
 
Old 11-07-2011, 11:49 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
The links starting with K determine the scripts that are started with the stop parameter when switching to that runlevel, while the scripts starting with S are launched with the start parameter.
 
Old 11-07-2011, 11:58 PM   #3
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
'K' and 'S' scripts are used to represent the type of execution

scripts starting with K are executed before S scripts

Code:
(rest is explained by TobiSGD)
 
Old 11-08-2011, 12:38 AM   #4
jhonnappier2007
LQ Newbie
 
Registered: Nov 2011
Posts: 17

Original Poster
Rep: Reputation: Disabled
let me make it clear.

I have a script to start up the tomcat server.
i linked the script like this /etc/rc0.d/K60myscript
does this kills the tomcat process at system shutdown??
Actually the purpose is the script contains statements to create and delete some files.
 
Old 11-08-2011, 07:08 AM   #5
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by jhonnappier2007 View Post
let me make it clear.

I have a script to start up the tomcat server.
i linked the script like this /etc/rc0.d/K60myscript
does this kills the tomcat process at system shutdown??
Actually the purpose is the script contains statements to create and delete some files.
No it will execute that script but make sure you create a symlink of your script to /etc/init.d

Code:
#ln -s /etc/init.d/myscript.sh /etc/rc0.d/K60myscript.sh 
#ln -s /etc/init.d/myscript.sh /etc/rc6.d/K60myscript.sh
 
Old 11-08-2011, 07:43 AM   #6
jhonnappier2007
LQ Newbie
 
Registered: Nov 2011
Posts: 17

Original Poster
Rep: Reputation: Disabled
Thank u all for the reply
 
  


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
Starting scripts as non-root rabalder321 Linux - Newbie 4 12-09-2005 09:08 AM
X not starting on boot (init scripts) cootetom Mandriva 11 05-05-2004 09:37 AM
Some rc.d Scripts Not Starting granatica Linux - Software 4 03-17-2004 06:07 PM
Scripts for Starting Window Manager jasonmiu Red Hat 0 09-19-2003 02:03 PM
sysV vs bsd starting scripts sqn Linux From Scratch 3 06-16-2002 02:42 AM


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