How to execute script automatically after startup with root priviliges

There are 2 ways to do this:

  1. Simply put the commands you want at /etc/rc.local
  2. Put your script in the /etc/init.d directory. After you make the script executable, use the following command to add the symbolic links: Code:
update-rc.d your_script_name defaults

If you ever want to remove the script from the startup sequence, use this: Code:

update-rc.d -f  your_script_name remove

You might want to give a look at the update-rc.d man page for further options you can use with the command.

You may also like