LinuxQuestions.org
Review your favorite Linux distribution.
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 08-19-2008, 10:55 AM   #1
G00fy
Member
 
Registered: Jul 2004
Location: Herent, Belgium, Europe, Earth
Distribution: Ubuntu 7.04
Posts: 102

Rep: Reputation: 15
rc.d startup/shutdown sequence


This might be a very trivial question, but I fail to find any information about the subject (besides telling that rcorder will do it).

What is the order the startup/shutdown scripts are executed in?

Logically I would say:
Startup: S00 -> S99
Shutdown: K00 <- K99


Is this correct?
 
Old 08-19-2008, 09:21 PM   #2
eggixyz
Member
 
Registered: Apr 2008
Posts: 310

Rep: Reputation: 30
Hey There,

You are absolutely correct, I think.

For S and K, the order of execution follows these rules:

1. 0 is executed first and then all numbers sequentially through 9. Note that the numeric order is kind of like what you'd get from the output of "sort", so if you had:

0 1 2 3 12

the order would be

0 1 12 2 3

The numbers are usually 2 digit, by standard, but can be any number of digits you want - they just need to be in that same sort of sequential order.

2. After the numbers it works alphabetically. Most systems differentiate between upper and lower case, so

S99Zebra

would come before

S99apache

If your distro's rc doesn't pay attention to case, the opposite would be true.

3. The alphabetical order is then judged by each succeeding place, if the previous place is a match between 2 or more file

S99apache

would come before
S99azaza

4. Then it continues on in any fashion you want (you can keep adding numbers and letters), so,

S99apache4

would come after

S99apache

but before

S99 apache5

,etc

but the standard is:

S/K DOUBLE-DIGIT-NUMBER-Name

S99apache or K99apache

Hope that helps clarify

Best wishes,

Mike

Quote:
Originally Posted by G00fy View Post
This might be a very trivial question, but I fail to find any information about the subject (besides telling that rcorder will do it).

What is the order the startup/shutdown scripts are executed in?

Logically I would say:
Startup: S00 -> S99
Shutdown: K00 <- K99


Is this correct?
 
Old 08-20-2008, 01:53 AM   #3
G00fy
Member
 
Registered: Jul 2004
Location: Herent, Belgium, Europe, Earth
Distribution: Ubuntu 7.04
Posts: 102

Original Poster
Rep: Reputation: 15
Thanks for your elaborate explanation, but for the startup I also want to add (for completeness sake & if other people are searching for this) that "rcorder" also takes account of the REQUIRE parameter in order to place them correctly. Or that's what I've been reading.

My question though is not 100% answered because I'm still in the dark about the kill scripts...
Does it also move from 00 -> 99 or does it go from 99 -> 00?

So when I have a program depending on the database I would do:
S50database
S51db_prog

K51db_prog
K50database

So on startup the program is started after the database, and at shutdown it's stopped before the database. Or should I do:
S50database
S51db_prog

K50db_prog
K51database

To have the database program stopped first and after that the database?


Thanks
 
Old 08-21-2008, 01:41 AM   #4
eggixyz
Member
 
Registered: Apr 2008
Posts: 310

Rep: Reputation: 30
Thanks

The kills go from 00 - 99, so if you startup with

S98program

You might want to kill with

K10program

So the program dies before the services it depends on.

Best wishes,

Mike
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Need help adding a script to shutdown sequence trapix22 Linux - Newbie 1 12-29-2007 01:08 AM
can someone tell me the sequence of x startup ? nkd Linux - Newbie 9 10-20-2007 12:41 AM
FC5 shutdown sequence blank screen General Fedora 4 04-23-2006 12:44 PM
gnome startup sequence n_hendrick Linux - General 0 12-08-2004 11:08 PM
Knoppiz, Why go through shutdown sequence? jlturbos Linux - Distributions 3 02-09-2004 09:06 PM

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

All times are GMT -5. The time now is 08:47 AM.

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