stop container before unmounting logs

This commit is contained in:
Aiden McClelland
2024-07-29 13:18:04 -06:00
parent 0bc6f972b2
commit bca75a3ea4
2 changed files with 29 additions and 32 deletions

View File

@@ -288,6 +288,11 @@ impl LxcContainer {
#[instrument(skip_all)]
pub async fn exit(mut self) -> Result<(), Error> {
Command::new("lxc-stop")
.arg("--name")
.arg(&**self.guid)
.invoke(ErrorKind::Lxc)
.await?;
self.rpc_bind.take().unmount().await?;
if let Some(log_mount) = self.log_mount.take() {
log_mount.unmount(true).await?;