Summary of feature
In the last week, I implemented the ability to trigger a system reboot, update, or shutdown for any pi (or the NAS box) through the database. I also enabled a way to do this using the commandline for convenience until we have the Staff GUI. This allows easy updating of the river system software, as well as clean reboots and shutdowns with proper river system software shutdown procedures.
Shutting down any one pi/the NAS box
Using the database
To use the database, edit the *Control table that matches the site_id for that device to read, for example:
Code: Select all
Record ID Device ID Device Status Request Locked By
1 SUMP Locked Shutdown NAS
<... other records ...>
Using the commandline
SSH in to that device and run:
Code: Select all
touch /tmp/.shutdown
Rebooting any one pi/the NAS box
Using the database
To use the database, edit the *Control table that matches the site_id for that device to read, for example:
Code: Select all
Record ID Device ID Device Status Request Locked By
1 SUMP Locked Reboot NAS
<... other records ...>
Using the commandline
SSH in to that device and run:
Code: Select all
touch /tmp/.reboot
Shutting down the whole system
Using the database
To use the database, edit the NASControl table to read:
Code: Select all
Record ID Device ID Device Status Request Locked By
1 NAS Locked Shutdownall NAS
<... other records ...>
Using the commandline
SSH in to the NAS box (required your public key to be installed) and run:
Code: Select all
touch /tmp/.shutdownall
Rebooting the whole system
Using the database
To use the database, edit the NASControl table to read:
Code: Select all
Record ID Device ID Device Status Request Locked By
1 NAS Locked Rebootall NAS
<... other records ...>
Using the commandline
SSH in to the NAS box (required your public key to be installed) and run:
Code: Select all
touch /tmp/.rebootall
Updating the whole system
NOTE: This method does not allow you to update only a single pi - we don't want to do that during normal operation. Only an engineer should be updating individual pis, and they will have the know-how to do that without this convenience procudure.
Preparation
Create a gzipped tarball (.tar.gz file extension) containing the new software. This should unpack to create a "rivercontrolsystem" directory with the framework inside. Place this file at "/mnt/HD/HD_a2/rivercontrolsystem.tar.gz" on the NAS box (use scp or SSH in and use a USB stick to do this).
Using the database
To use the database, edit the NASControl table to read:
Code: Select all
Record ID Device ID Device Status Request Locked By
1 NAS Locked Update NAS
<... other records ...>
Using the commandline
SSH in to the NAS box (required your public key to be installed) and run:
Code: Select all
touch /tmp/.update