How to use update-rc.d to add extra services (Ubuntu)

So from my last two posts i have made a new /etc/init.d script and changed the permissions so we can run it.

I have tested the script by calling it by hand

/etc/init.d/extras start

This command ran my script and started the service now to make it run on boot

update-rc.d extras defaults 91

What does this mean?

update-rc.d = the application that manages the runlevel stuff

extras = the filename of my script (/etc/init.d/extras)

defaults = This tells update-rc.d that i want it to start the service when the computer starts

and stop it when the computer shutsdown (its more complex but thats close enough)

91 = is the priority that it should run at(1 – 100). This defines the order that things happen at boot (and halt) time

I have chosen 91 because i want the machine to start this service close to the end of the boot sequence.

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