dmwm / CRABServer

15 stars 38 forks source link

avoid exiting container on command error #8539

Open belforte opened 2 weeks ago

belforte commented 2 weeks ago

when inside e.g. TW container with docker exec -ti TaskWorker bash, after I do source env.sh or source env.sh -g to test things locally, the set -eou pipefile "persists" so that any command with non zero exit status results in exiting the container.

Would it be possible to add set +e at the end of env.sh ? Or will it cause problems elsewhere ?

novicecpp commented 2 weeks ago

Would it be possible to add set +e at the end of env.sh ?

Yes. You can put a whole set +eou pipefile to avoid annoying unbound variable errors and the pipe failing too.

belforte commented 2 weeks ago

I tried various things but while "exit on failed command" is gone at first approximation, if I run source env.sh -g again it fails to detect the mode, complains, and exit the bash shell. Maybe the consequence of the set -auo pipefail in the container itself. I leave it to you

novicecpp commented 2 weeks ago

Sure, I will have a look tomorrow.

belforte commented 2 weeks ago

not urgent