Blog » Blog Entry

Debian rc.local howto

December 5, 2006

If you're using a flavor of *nix that has an rc.local file, and then you start using Debian GNU/Linux, you might be wondering where your rc.local file is. Quite simply, it's not there. Here's how to add it.

Create a new file named /etc/init.d/local like this:

#!/bin/sh
# put startup stuff here

Make the file executable:

chmod 755 /etc/init.d/local

Add it to startup:

update-rc.d local defaults 80

You should be seeing something like this:

Adding system startup for /etc/init.d/local ...
/etc/rc0.d/K80local -> ../init.d/local
/etc/rc1.d/K80local -> ../init.d/local
/etc/rc6.d/K80local -> ../init.d/local
/etc/rc2.d/S80local -> ../init.d/local
/etc/rc3.d/S80local -> ../init.d/local
/etc/rc4.d/S80local -> ../init.d/local
/etc/rc5.d/S80local -> ../init.d/local
Tags: debian, howto, rc.local

« Eggdrop iptables firewall rules Debian GNU/Linux Kernel Howto »

Actually...

By: Wouter Verhelst <wouter at debian dot org>

Posted: 1 month ago

Actually, the support *is* there. It's just that on a default install, the file isn't created, which seems silly -- but, well.

Just create a file /etc/rc.local, and make it executable. That's all you need to do...

Well.. Actually..

By: Greg Donald <gdonald at gmail dot com>

Posted: 1 month ago

That's a blog entry from nearly 2 years ago, and who knows how old the version of Debian was that I was blogging about on that day..

So then today when I look at a brand new "default" Debian (Etch) install I created in a VM yesterday, it does indeed already have an /etc/rc.local file:

> cat /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

exit 0

Oops :)

By: Wouter Verhelst <wouter at debian dot org>

Posted: 1 month ago

Yeah, sorry, I hadn't noticed that. Someone had linked to it someplace, apparently.

Oh well.

Add a comment:

Title:

Comment:

Name:

Email: