Linux

Add boot script on linux

Since I always forgot the information about how to add boot script I fought I should add it here:

Usually the script that should be stored should be placed in the path /etc/init.d/ then a reference (link) from the /etc/rc[1-6].d paths to the script is used to start the script at boot.

Depending on the start-sequence the script should have it should be placed in the different directorys, Example: where the rc0.d directory is first path to go thru, and the rc6.d is run last etc..

First: Man pages for the rc is used like this: #man update-rc.d

Example if we have a script in /etc/init.d/startUpScript

To add a script as default:
#update-rc.d -n startUpScript defaults

To remove it:
#update-rc.d -n startUpScript remove

Leave a Reply

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