Directory to Place a Startup Script in Ubuntu

Case: A sudo-installed application needs to be run as local user upon startup AND/OR a shell script is required to be called upon startup.

Call the desired script from /etc/rc.local and it will run as root on startup.

To run as local user: sudo -u username /full/path/to/application

When creating a shell (.sh) script to call, start with: #!/bin/sh -e
or whatever environment you would like to include, ex: #!/usr/bin/env python

Sources

 

 

Did this solve your issue?