Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Differences between /etc/init.d and /etc/rc.d/init.d 3

Status
Not open for further replies.

itsp1965

IS-IT--Management
Dec 9, 2003
2,669
CA
Hello folks, I apologize if this has been answered before, I have a question in regards to scripts that run under /etc/init.d and /etc/rc.d. Now I know that the rc.d directory stores scripts that start services at different runlevels. We have an application that installs the startup script in /etc/init.d. Do /etc/init.d scripts start after the OS has loaded? And what is the difference between /etc/init.d and /etc/rc.d/init.d. Can someone please clarify the differences. Thank you.
 
Yup, normally a symlink to the same files..

I believe there's a historical compatibility that creates the "need" for both folders to exist. Couldn't tell you why, but that's my understanding.

D.E.R. Management - IT Project Management Consulting
 
Hi,

In /etc/init.d, you have original scripts written by someone and containing some comment lines necessary for chkconfig like this :
Code:
/etc/init.d:head -5 ged.rc.lsnrctl
#!/bin/ksh
#
# chkconfig: 34 61 61
# description: demarrage du listener oracle
# processname: ged.rc.lsnrctl
...
chkconfig: 34 61 61

Here 34 means that the script is active in run levels 3 and 4
61 61 is an order number for start and shutdown if you want to order the execution of start or shutdown scripts( S61 in run levels 3 and 4, and K61 in run levels 0 1 2 5 6)

the following names are all symbolic links to the original file
Code:
etc/rc.d:find /etc/rc.d -name "?61*"
[b]/etc/rc.d/rc3.d/S61ged.rc.lsnrctl
/etc/rc.d/rc4.d/S61ged.rc.lsnrctl[/b]
/etc/rc.d/rc5.d/K61ged.rc.lsnrctl
/etc/rc.d/rc0.d/K61ged.rc.lsnrctl
/etc/rc.d/rc6.d/K61ged.rc.lsnrctl
/etc/rc.d/rc1.d/K61ged.rc.lsnrctl
/etc/rc.d/rc2.d/K61ged.rc.lsnrctl

This S61 and K61 are generated when you make :
Code:
chkconfig --add ged.rc.lsnrctl
they are deleted if you type
Code:
chkconfig --del ged.rc.lsnrctl
they are listed
Code:
chkconfig --list ged.rc.lsnrctl
ged.rc.lsnrctl  0:off   1:off   2:off   [b]3:on    4:on[/b]    5:off   6:off





 
Thank aau, that was very comprehensive explanation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top