status.json Details
By default, the basic status of your custom application will be displayed in the Conduit® UI and on DeviceHQ® and will generally be Started or Stopped. By default, we don’t know whether your application is truly running or not.
However, if you provide status.json in the format described below, app-manger check if a process with the given pid is running. If it is, your app status will be reported as Running. If it was previously running and app-manager discovers it’s no longer running, your app status will be Failed.
Additionally, you can set the AppInfo field of status.json to use as a custom status reporting mechanism. The Status field in the UI and on DeviceHQ will always be set by app-manger, but the Info field will be read directly from status.json if it’s available.
status.json requirements:
- Optionally present at the top level of a custom app tarball
- The file must be JSON format.
- For
app-manager
to use this file after installation, it must be located at /media/card/<app_name>/status.json
Format Details
Key |
Value Type | Description |
pid | Integer | The PID of your app process. Your app must set this at runtime if you want full status reporting. Each supported language has a built in mechanism for getting your current PID. See the provided sample apps for examples.app-manager will use this PID to determine app status by doing kill -0 <pid> to see if the process is running. See below information on possible app statuses.If you include this file as part of the tarball, it’s recommend to set the pid to 0 as default. |
AppInfo | String | Can contain any string up to 160 characters and will be displayed on the Conduit and DeviceHQ UI’s. This is a good way to display application state or errors. |
Example
{ “pid”: 2374, “AppInfo”: "Started processing" }
Status Values
The status of your app as determined by app-manager will be displayed in the Conduit and DeviceHQ UI’s. This value is determined by whether a process with the pid as set in status.json is running or not.
Possible statuses:
- STARTED
- RUNNING
- STOPPED
- FAILED
- INSTALL FAILED
- START FAILED
Possible status transitions: