Skip to content

Commit

Permalink
feat: close the firecracker VM when cyclone exits
Browse files Browse the repository at this point in the history
  • Loading branch information
sprutton1 committed Jan 9, 2024
1 parent 56bfb47 commit df82923
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
8 changes: 1 addition & 7 deletions lib/deadpool-cyclone/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,7 @@ where
obj: &mut Self::Type,
_: &Metrics,
) -> managed::RecycleResult<Self::Error> {
match obj.ensure_healthy().await {
Ok(_) => Ok(()),
Err(err) => {
obj.terminate().await?;
Result::map_err(Err(err), Into::into)
}
}
obj.ensure_healthy().await.map_err(Into::into)
}
}

Expand Down
6 changes: 4 additions & 2 deletions prelude-si/rootfs/rootfs_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,13 @@ cat <<EOF >"/etc/init.d/cyclone"
name="cyclone"
description="Cyclone"
supervisor="supervise-daemon"
command="cyclone"
command_args="${cyclone_args[*]}"
pidfile="/cyclone/agent.pid"
output_log="/var/log/cyclone.log"
error_log="/var/log/cyclone.err"
start(){
cyclone ${cyclone_args[*]} && reboot &
}
EOF
chmod +x "/etc/init.d/cyclone"
Expand Down

0 comments on commit df82923

Please sign in to comment.