Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am using a TS-7800 single board computer from Technologic Systems that ships with Debian 3.1 (Sarge). I have updated it to Squeeze, but due to various driver issues I have been forced to roll back to Sarge. I am attempting to configure the various drivers and configurations needed for my application services before they start. Ideally I would call one init.d script that contains the drivers / configurations then call the other init.d scripts (one for each process).

I am left scratching my head on how to guarantee the boot sequence. I know in later versions of Debian I could use the lbs-header to achieve this; but is there anything comparable to the LBS header in Sarge?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Instead of manually creating the symlinks, I'd recommend using the update-rc.d command to handle creating the symlinks for you in the appropriate runlevels.

For instance:

  1. Create /etc/init.d/myscript
  2. Run update-rc.d /etc/init.d/myscript defaults 20

The argument defaults states to use the default runlevels for starting and stoping the service and the argument 20 dictates the sequence number.

You can find more information at:

  1. Question 11.6 of the Debian GNU/Linux FAQ
  2. The Debian Administration article "Making scripts run at boot time with Debian"

Don't forget to daemonize your scripts if needed.

share|improve this answer
    
Aah great, I didn't have a sarge instance handy to check what the method was. Understanding the mechanism is useful to the OP I reckon as well. –  Paul Dec 10 '12 at 20:38
add comment

You can do this yourself. At boot up time scripts in /etc/rcS.d are executed first. There are no actual scripts in here, just symlinks to /etc/init.d/ scripts

They are prefixed with Sxx where xx is a number, and defines the sequence they are executed.

So lets say your script is /etc/init.d/mydriverscript, then

ln -s /etc/init.d/mydriverscript /etc/rcS.d/S01mydriverscript

And then it will execute at boot time before any other scripts. If you'd prefer to run it only in specific run levels, then you can use the /etc/rc3.d folder instead, which will run it only if you are in runlevel 3.

share|improve this answer
    
This works great as far as the boot order. Now I just need to get the scripts to run correctly. Thanks! –  Adam Lewis Dec 10 '12 at 14:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.