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

Posted on Updated on


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

You should see a line like this:

id:2:initdefault:

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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s