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-daemon
to 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-manager
launched 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-manager
executes the Start script with the stop argument app-manager
installs the app via the Install scriptapp-manager
executes the Start script with the start argument- The Conduit® checks into DeviceHQ to report new Installed Apps information
Uninstall Process
app-manager
launched to uninstall a custom appapp-manager
executes the Start script with the stop argumentapp-manager
uninstalls 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-manager
for all installed apps - For each app, customapp launches
app-manager
to start it app-manager
executes the Start script with thestart --initd
arguments
Shutdown Process
- Conduit shutdown initiated
- The /etc/init.d/customapp init script is executed with priority 95
- customapp queries
app-manager
for all installed apps - For each app, customapp launches
app-manager
to stop it
app-manager
executes the Start script with thestop --initd
arguments
Config Install Process
app-manager
launched to install an app config from a scheduled DeviceHQ actionapp-manager
downloads the new config file and places it in the config/ directory, overwriting any existing files.app-manager
executes the Start script with the reload argument