Debian: Starting up stuff at boot time (rc.locals)

Execute this command to find your default runlevel:
cat /etc/inittab | grep initdefault

You should see a line like this:


That means 2 is your default runlevel. This may also be 3, or rarely 4 or 5. Create your rc.local file like this (as root):

touch /etc/init.d/rc.local
chmod 774 /etc/init.d/rc.local

Set it to be run at boot time by doing this:

ln -s /etc/init.d/rc.local /etc/rcX.d/S99local

Replace the X with your default runlevel from step one. For example, rc2.d. Edit your /etc/init.d/rc.local script.

This’ll cause your rc.local script to be run last during the bootup process (because of the 99). This is generally what you want to do, to make sure your network connection is up and all the basic services are started before your custom startup script runs.

Share it now...
Share on Facebook0Tweet about this on TwitterEmail this to someoneShare on Google+0
The following two tabs change content below.
Unix/Linux enthusiasts, good working experience with SAN, NAS, Linux, Solaris, AIX, VMWare & Graphic Design. Certified for Solaris Admin, EMC & HDS Storage.

Leave a Reply

Your email address will not be published. Required fields are marked *