Jump to content

How does runlevels work?


Recommended Posts

Can anyone explain to me how the runlevels work.

 

I want my mandrake to run a script at startup. I already put the script in the "init.d"

folder and made symbolic links from the rc3.d and rc6.d (an example told me to do It this way).

 

I understand what I'm doing up to that point, but I need clarification on two things

1. What is the differences between the run levels

2. Why are all the links named with a K80<filename> or S01<filename>.

Link to comment
Share on other sites

Ok I tried this and it did not work. I thing my script wont run from the startup folder.

 

Is there somewhere I can put a command to run the script from it's original location.

 

Note that I want to run it when the pc starts up (before login)

Link to comment
Share on other sites

quick answer

 

the run levels are

1 single user

2 multi user

3 network

4 unused

5 graphic

6 reboot

0 stopped

 

The scripts in each directory are run alphabetically ... Sxxname since they are always Sxx or Kxx unless the Sxx has the same value as another they run numerically...

 

If they are both S80ascript and S80xscript then the ascript will run first...but obviously S79xscript runs before S80ascript

 

The S means start and the K means kill.

If you are accending run levels then you run S scripts and decending K scripts

 

if it starts with any other letter it is ignored!

 

Thus from 3->5 will run S scripts.. these will mainly be the display manager etc. to startx

from say 3->2 will be network K scripts to stop not only networking but services dependent on it first.... like httpd or ftpd etc.

 

hope that helps...

if not there is an excellent explanation on the IBM site...

cybrjackle once linked to it but its a linux article on making linux boot faster...

However it has a very good explanation of run levels...I might pop back and link it but try finding it in the meantime...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...