- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: about scripts in /etc/rc.d
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2004 10:08 PM
03-23-2004 10:08 PM
about scripts in /etc/rc.d
I like to know what is the significance of numbers in front of the softlinks in /etc/rc.d/rc3.d or rc6.d or...
The S indicates 'start' and K indicates 'kill'.
But what for the number?
For example I have seen S85httpd in rc3.d dir.
The number 85 stands for what?
Please brief
thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2004 10:35 PM
03-23-2004 10:35 PM
Re: about scripts in /etc/rc.d
and that's the whole trick.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2004 10:45 PM
03-23-2004 10:45 PM
Re: about scripts in /etc/rc.d
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2004 10:56 PM
03-23-2004 10:56 PM
Re: about scripts in /etc/rc.d
They have explained everything neatly in the above link .. (who cares if it is a SUN site as long as the information provided applies to HP-UX aswell .. well it applies more or less)
-Karthik S S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2004 10:57 PM
03-23-2004 10:57 PM
Re: about scripts in /etc/rc.d
I will be writing a script that should be called when reboot is given. So i will have a soft link to my script in /etc/rc.d/rc6.d directory.
I have seen all the file are having some numbers. see below:
K05news -> ../init.d/news
K08iBCS -> ../init.d/iBCS
K09samba -> ../init.d/samba
K12squid -> ../init.d/squid
K25gpm -> ../init.d/gpm
K25httpd -> ../init.d/httpd
K55snmpd -> ../init.d/snmpd
S99reboot -> ../init.d/reboot
I will be giving name of my script link which will start with 'S' . But what number I have to assign?
Is there any order these scripts should be called based on the numbers?
thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2004 11:10 PM
03-23-2004 11:10 PM
Re: about scripts in /etc/rc.d
If you want a script to be invoked upon reboot then you must name it starting with the character 'K' and place it in /etc/rc.d/rc6.d directory. You can give it any number but unique one.
ex:
K77your_script
-Karthik S S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2004 12:29 AM
03-24-2004 12:29 AM
Re: about scripts in /etc/rc.d
if you have Snnxxx in rc2.d you will/should have Kmmxxx in rc1.d
The rule is mm + nn = 1000
The order is taken by this number , Therefore the last started daemons are killed first.
Jean-Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2004 02:01 AM
03-24-2004 02:01 AM
Re: about scripts in /etc/rc.d
As already said by other, the numbers determine the executing sequence of the scripts in the rcn.d directory. The 'n' is the runlevel (RedHat: 3 multi user, 5: Graphical multiuser). See /etc/inittab.
An easier way of maintaining all these softlinks is using chkconfig.
chkconfig -add service
chkconfig service on
chkconfig --list service
Check the manpage.
A commentline in your script may be needed. Check other scripts in /etc/init.d for an example.
JP.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2004 03:48 AM
03-24-2004 03:48 AM
Re: about scripts in /etc/rc.d
Greetings, Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2004 07:59 AM
03-24-2004 07:59 AM
Re: about scripts in /etc/rc.d
The K01blah symlink will be called with "stop" argument and the S01blah will be called with "start" argument
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2004 09:58 AM
03-24-2004 09:58 AM
Re: about scripts in /etc/rc.d
Simply, /etc/rc.d/rc gets called by 'init', and does simple loops like:
for i in /etc/rc.d/rc6.d/K*
do
$i stop
done
(NOTE: On RH, it literally *IS* "for i in"!)
The numbers give the basic order of execution. All you really need to take into account is that your process is started after it's required subsystems are started, and stopped before it's required subsystems are stopped.
Usually this means you have a high S value (for rc 2/3/4/5), and a low K value (for rc 0/6).
As was said in the previous post, the values for S and K should add up to 100, but that isn't a 'rule', it's just a good guideline for keeping the start-up/shut-down orders equivalent.
Also note, that the order numbers are *ALWAYS* zero padded, i.e.:
S99MyRoutine
K01MyRoutine
To get an idea what order the start/stop will occur in, simply issue:
echo /etc/rc.d/rc3.d/S*
This will show the order they'll be executed in.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2004 08:08 PM
03-24-2004 08:08 PM
Re: about scripts in /etc/rc.d
Deepa