Start Script
Start Script Details
A template Start script is provided in the custom app template tarball. The Start script is responsible for starting and stopping the application.
- Required to exist at the top level of the application tarball
- It must accept the following command line arguments: start, stop, restart, and reload.
- The provided template shows how to use
start-stop-daemonto start and stop your app, but this script can be fully customized to use whatever start/stop mechanism you wish. - Apps will be automatically started after install and on boot and stopped on shutdown.
- This script is always run as root. Don’t forget to make the permissions on the Install script executable by the appropriate user.
The below process flows show exactly when and how the Start script is executed.
Install Process
app-managerlaunched to install a custom app either from a DeviceHQ® command or manually from the command line- If a version of the app is already installed,
app-managerexecutes the Start script with the stop argument app-managerinstalls the app via the Install scriptapp-managerexecutes the Start script with the start argument- The Conduit® checks into DeviceHQ to report new Installed Apps information
Uninstall Process
app-managerlaunched to uninstall a custom appapp-managerexecutes the Start script with the stop argumentapp-manageruninstalls the app via the Install script.The Conduit checks into DeviceHQ to report new Installed Apps information
Boot Process
- Conduit starts boot process
- The /etc/init.d/customapp init script is executed with priority 95
- customapp queries
app-managerfor all installed apps - For each app, customapp launches
app-managerto start it app-managerexecutes the Start script with thestart --initdarguments
Shutdown Process
- Conduit shutdown initiated
- The /etc/init.d/customapp init script is executed with priority 95
- customapp queries
app-managerfor all installed apps - For each app, customapp launches
app-managerto stop it
app-managerexecutes the Start script with thestop --initdarguments
Config Install Process
app-managerlaunched to install an app config from a scheduled DeviceHQ actionapp-managerdownloads the new config file and places it in the config/ directory, overwriting any existing files.app-managerexecutes the Start script with the reload argument