LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-16-2008, 11:41 AM   #1
SlowCoder
Senior Member
 
Registered: Oct 2004
Location: Southeast, U.S.A.
Distribution: Debian based
Posts: 1,250

Rep: Reputation: 164Reputation: 164
Meaning of numbers in rc.d startup links


I read for the day was about how Linux handles runlevel scripts. Good read, and I understand it. Whew!

But I have one question that was not quelled by my research.

Take the name of the /etc/rc5.d/S99firstboot link. Other than simple lowest to highest priority when starting and stopping services, is there a significance to the 99? I see multiple S99* links in /etc/rc5.d, and the only thing that might separate them is the alphabetical order in the start/stop sequence.

Also, what happens if you should not shutdown a particular service when changing runlevels?

Last edited by SlowCoder; 05-16-2008 at 11:43 AM.
 
Old 05-16-2008, 12:35 PM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
is there a significance to the 99?
No, I don't think so. The 99 just means that it is run after all the scripts with lower numbers.
The reason for the numbers is so that services are started, and stopped, in the proper order because some services depend on the availability of other ones to intialise, shutdown cleanly (eg you can't write something to a log file, if you have already unmounted the filesystem), or work properly.
Quote:
I see multiple S99* links in /etc/rc5.d, and the only thing that might separate them is the alphabetical order in the start/stop sequence
Yes. But I am not sure that the order is defined as alphabetical or anti-alphabetical or anything else. Maybe there is an RFC somewhere? It is possible that equal numbers could all be permitted to be run concurrently by putting them in the background.
Quote:
Also, what happens if you should not shutdown a particular service when changing runlevels?
Then you might not be changing the runlevel "properly". This might be something you need or want though, it depends on your circumstances, and you need to be a careful. For example if you wanted to switch to runlevel 1 (Single user) and you omitted to shutdown and kill all running users, or allowed them to login again after they had been killed, you wouldn't be in "singleuser" mode anymore, would you?

However, there will be occasions when you need to start or stop some service running in your current runlevel, that was not defined to do so in the rc?.d scripts. For example, you are in runlevel 3 and your system is not set up to run sshd in that runlevel. You can easily start it yourself with /etc/init.d/ssh start

The only differences between runlevels is which services are running, or not.

HTH
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
technical question about hard links v soft links 7stud Linux - Newbie 2 02-23-2007 06:57 PM
sequence of numbers, how to extract which numbers are missing jonlake Programming 13 06-26-2006 03:28 AM
links (hard links and soft links..) sachitha Programming 1 08-10-2005 12:10 PM
Symbolic links and programms on startup evilmonkey Linux - Software 5 10-24-2004 02:28 PM
Adding numbers, break on non-numbers... Cruger Programming 1 03-22-2004 09:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

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