Debian: /etc/rc.d/rc.local Equivalent

In many distributions you can add commands to run certain programs at the end of the boot process after all system services have been started into the /etc/rc.d/rc.local file, however there is no such file in a Debian system. Here is the way to accomplish the same thing the debian way:

Create a file named local in /etc/init.d/, for example:

#!/bin/bash
# Add all the scripts to run after system startup
/usr/local/apache/bin/apachectl start

Make the file executable. And then do the following, to create the necessary entries in /etc/rc*.d/

root@ramhome:/etc/init.d# 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

Leave a Reply

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