Create Startup Script in Linux

linux startup
Created on 2016-10-21 Last Modified 2018-06-26


Create a new script in /etc/init.d/myscript.

vi /etc/init.d/myscript

(Obviously it doesn’t have to be called “myscript”.) In this script, do whatever you want to do. Perhaps just run the script you mentioned.

#!/bin/sh
/path/to/my/script.sh

Make it executable.

chmod 755 /etc/init.d/myscript

Configure the init system to run this script at startup.

update-rc.d myscript defaults

ystem to run this script at startup.

update-rc.d myscript defaults

comments powered by Disqus