How to run a script at boot automatically

From Wiki Kaeilos.com
Jump to: navigation, search

How to run a script at boot automatically using Linux

If you need to run a script at boot automatically using Linux, this is the easiest solution. this covers only System V behaviour and of course doesn't cover the various aspects of different runlevels nor the service kill at shutdown.

  • Create a script file
# vi /etc/init.d/rc.local

...edit the script file calling your applications.


  • Modify the executable flag
# chmod +x /etc/init.d/rc.local


  • Activate the service at boot
# update-rc.d rc.local start 99 5 .

... this creates a symbolic link in /etc/rc5.d


  • In case you want to remove the service
# update-rc.d -f rc.local remove