LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Scripts starting with K in /etc/rc#.d/ (https://www.linuxquestions.org/questions/linux-newbie-8/scripts-starting-with-k-in-etc-rc-d-912404/)

jhonnappier2007 11-07-2011 10:24 PM

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.

TobiSGD 11-07-2011 10:49 PM

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.

deep27ak 11-07-2011 10:58 PM

'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)

jhonnappier2007 11-07-2011 11:38 PM

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.

deep27ak 11-08-2011 06:08 AM

Quote:

Originally Posted by jhonnappier2007 (Post 4518533)
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


jhonnappier2007 11-08-2011 06:43 AM

Thank u all for the reply
:)


All times are GMT -5. The time now is 06:41 PM.