Skip to content

Commit

Permalink
enter: properly handle container stopping during first setup. Fix #1133
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Di Maio <[email protected]>
  • Loading branch information
89luca89 committed Feb 3, 2024
1 parent 31f0c52 commit ed5c620
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions distrobox-enter
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,11 @@ if [ "${container_status}" != "running" ]; then
rm -f "${app_cache_dir}/.${container_name}.fifo"
mkfifo "${app_cache_dir}/.${container_name}.fifo"
while true; do
# Exit early in case of crashed/stopped container during setup
if [ "$(${container_manager} inspect --type container --format '{{.State.Status}}' "${container_name}")" != "running" ]; then
printf >&2 "\nContainer Setup Failure!\n"
exit 1
fi
# save starting loop timestamp in temp variable, we'll use it
# after to let logs command minimize possible holes
${container_manager} logs -f "${container_name}" 2> /dev/null \
Expand Down

0 comments on commit ed5c620

Please sign in to comment.