tremplin: Refactor shutdown
Refactor shutdown to make it faster and more reliable:
* Forward SIGPWR to LXD before stopping the gRPC server. The latter can
take a little while, so it's important that LXD gets the signal first.
* Allow LXD to manage shutdown, rather than trying to run `poweroff` in
each container.
* Set `core.shutdown_timeout` to 0 minutes so that LXD does not wait for
operations to complete before shutting down.
BUG=b:286370009
TEST=Crostini shutdown takes 2-3s instead of 10+s
Change-Id: I332c3041f2f65f9aa70f6eb1c71debbec944c0b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/tremplin/+/5019620
Reviewed-by: Fergus Dall <sidereal@google.com>
Commit-Queue: James Ye <jamesye@google.com>
Tested-by: James Ye <jamesye@google.com>
2 files changed