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 11-07-2011, 10: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, 10:49 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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, 10:58 PM   #3
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
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-07-2011, 11:38 PM   #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, 06:08 AM   #5
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
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, 06:43 AM   #6
jhonnappier2007
LQ Newbie
 
Registered: Nov 2011
Posts: 17

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


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

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

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