Start a service when boot – Linux

This post describes how to place a script for running at Linux start up.

Write a bash script serviceX (e.g. “./home/you/x/bin/start” )

 
chmod +x serviceX
sudo cp serviceX /etc/init.d/serviceX
sudo chown root serviceX
sudo update-rc.d serviceX defaults
sudo service serviceX start

Tip: Use other files under /etc/init.d/ for reference.

Advertisements