Starting applications at boot

Nils Kassube kassube at gmx.net
Tue Jun 5 20:24:47 UTC 2007


Jan Sneep wrote:
> Interesting information about how the system starts and kills the
> various scripts.
>
> But it doesn't say how to add a script to rc2.d for example. Does one
> just arbitrarily pick a number to go before a copy of the script?
>
> I can understand starting at level S and then moving to Level 1 and
> then Level 2 for a server, but what triggers the system to move to
> level 3,4, & 5 ... level 6 is shutdown right?

Ubuntu only uses runlevel 2 for multi-user mode. Only if you want to have 
a special setup, you will need others. The runlevel change can be 
triggered manually by the command init see:

man -a init inittab initscript

About the number in the link: You can not pick a random number. The 
startup script starts the scripts in sequence beginning with the lowest 
number found up to the highest number. The number MUST be 2 digits. You 
should pick a number which is greater than the higher number of any 
service that has to be started before your script can work. I.e. if you 
need the sshd and cron running and their links are S20ssh and S89cron, 
you should use S90myscript. The command to make that link would be:

cd /etc/rc2.d
sudo ln -s ../init.s/myscript S90myscript


Nils




More information about the ubuntu-users mailing list