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
tree: df00e92897558f392e1c06a3be87dc522659c23f
  1. src/
  2. .gitignore
  3. DIR_METADATA
  4. OWNERS
  5. README.md
README.md

Tremplin

Tremplin is the “springboard” daemon that runs in the Termina VM and exposes a gRPC interface for managing LXD containers.