Open benfrancis opened 3 months ago
Is this actually necessary if snapd automatically restarts things when needed? Regardless it would be useful to have an implementation of the restart API which can be consumed by the front end to remotely reboot the gateway (as the power settings add-on does when running on Raspbian),
snapd will reboot the system itself under certain update conditions, namely when core things like the kernel update (I believe it is all of the kernel, snapd, or the gadget update).
Just in case you want an update of your own snaps to reboot the system, I would probably create a post-refresh
hook which ensures the update succeeded and then reboots the system.
Critically, the shutdown interface is now considered super-privileged; as such there's a bit more rigmarole to get it connected on Core.
OK, it sounds as though we may not actually need to expose an API for this to the front end for the use case of restarting after an upgrade. I'm therefore going to remove the 2.0 milestone from this one but keep the issue open because it would still be useful for add-ons, or to add a remote reboot feature to the front end.
On other platforms it's possible for the gateway to restart itself as part of setup and update procedures. This includes both restarting the gateway application, and restarting the whole operating system.
E.g. see https://github.com/WebThingsIO/gateway/blob/master/src/platforms/linux-raspbian.ts#L595