Difference between revisions of "How to run a script at boot automatically"
From KoanSoftware Wiki
(Created page with "== 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 Syst...") |
|||
Line 7: | Line 7: | ||
# vi /etc/init.d/rc.local | # vi /etc/init.d/rc.local | ||
+ | |||
+ | ...edit the script file calling your applications. | ||
Line 14: | Line 16: | ||
− | * | + | * Activate the service at boot |
# update-rc.d rc.local start 99 5 . | # 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 | # update-rc.d -f rc.local remove |
Latest revision as of 14:53, 19 July 2017
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