Demystifying rc*.d — startup scripts for everybody

First you gotta have some kind of shell script that you want to run on startup; say /etc/init.d/httpd.

Apache2 should run on boot, so we make a symbolic link to it in one (or more) run levels; e.g. /etc/rc5.d/.

# whoami
root
# cd /etc/rc5.d/
# ln -s ../init.d/httpd S85httpd
# ls -la | grep httpd
lrwxrwxrwx  1 root root   15 Mar 12 10:11 S85httpd -> ../init.d/httpd

Now the /etc/init.d/httpd script will run the next time the system boots to run level 5.

Advertisements

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