Home Download Ubuntu

Adding and removing service at system start-up Ubuntu

Adding and removing a script at system start-up is quite easy.

1. Adding a script at system start-up:
You need first to have a script. We make one by adding a file at /etc/init.d/

sudo nano /etc/init.d/our_script


Now add this lines:

#!/bin/sh
sudo /usr/local/bin/your_program


Exit editor and make it executable:

sudo chmod +x /etc/init.d/our_script


Now we adding it to system services:

sudo update-rc.d our_script defaults


2.Removing the script from system start-up:

We make our script non-executable:

sudo chmod -x /etc/init.d/our_script


Now we can delete the file if we don't plan of using it anymore:

sudo rm /etc/init.d/our_script


And remove it from system start-up:

sudo update-rc.d -f our_script remove


Resources: UbuntuBootupHowto

0 comments:

Post a Comment