Commit 837c96fd authored by Martin Peres's avatar Martin Peres
Browse files

initscript: be more resilient to containers returning non-0 exit code

parent 90bd4b83
......@@ -327,22 +327,23 @@ function start_container {
sleep .1
log "About to start executing a container"
podman start -a "$container_id"
exit_code=0
podman start -a "$container_id" || exit_code=$?
return $?
return $exit_code
}
function start_containers {
OLDIFS=$IFS IFS=$'\n'
for container_params in $(echo -e "$@"); do
start_container "$container_params"
exit_code=$?
exit_code=0
start_container "$container_params" || exit_code=$?
if [ $exit_code -eq 0 ] ; then
log "The container run successfully, load the next one!"
else
log "The container exited with error code $?, aborting..."
return 1
return 0
fi
done
IFS=$OLDIFS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment