Nothing starts imrest at boot
|Status:||Closed||Start date:||05 Jul 2018|
|Target version:||Iron Man - 0.5.0|
|Severity:||01 - Critical|
If we're in Pair Mode at power-up then S90imwww starts the php server for configuration. However, if we're not in Pair Mode then imrest should be started with NodeJS. But nothing is doing that right now.
The S90imwww script needs to support the imrest startup and shutdown. This means that runserver.sh should include an imrest mode that daemonizes the NodeJS server and stores its PID so the init script, via runserver.sh, can shut it down gracefully too.
RM #637: Fix up init script to properly start (via updated runserver.sh) either imwww or imrest, depending the state of the pair switch at boot time.
#1 Updated by Hammel over 2 years ago
- Status changed from New to In Progress
- % Done changed from 0 to 10
This requires changing the context of the Pair Mode button on the Pi. It now has to operate in dual modes just it does on the IoT device.
- If set at boot, we're in Config Mode. In this case start the PHP server to configure the monitor.
- If not set at boot, we're in Operational Mode. In this case start the NodeJS server.
- If set after boot, we're in Pair Mode. The NodeJS server must query this when receiving pair-related requests. This implies synchronously calling imgpio directly from NodeJS.
- S90imwww: Needs to know which server to start. Needs to be able to stop either server via runserver.sh.
- runserver.sh: Needs to know how to start NodeJS server. Needs to know how to stop both servers.
Note that pair.js in imrest already uses imgpio, via init.js, to check if pair mode is enabled.