I was always thinking that nothing should execute after bash exec command
but recently I found this Google Cloud example
#!/usr/bin/env bash
set -eo pipefail
# Create mount directory for service.
mkdir -p $MNT_DIR
echo "Mounting Cloud Filestore."
mount -o nolock $FILESTORE_IP_ADDRESS:/$FILE_SHARE_NAME $MNT_DIR
echo "Mounting completed."
# Run the web service on container startup. Here we use the gunicorn
# webserver, with one worker process and 8 threads.
# For environments with multiple CPU cores, increase the number of workers
# to be equal to the cores available.
# Timeout is set to 0 to disable the timeouts of the workers to allow Cloud Run to handle instance scaling.
exec gunicorn --bind :$PORT --workers 1 --threads 8 --timeout 0 main:app
# Exit immediately when one of the background processes terminate.
wait -n
Maybe my memory was wrong so I searched about this and found this and this. It looks like my memory was correct but maybe there are some exceptions from this.
Will this wait -n
actually work in this example?
Thanks.