HDFGroup / hsds

Cloud-native, service based access to HDF data
https://www.hdfgroup.org/solutions/hdf-kita/
Apache License 2.0
129 stars 53 forks source link

changed sleep to wait on PID for server cleanup #2

Closed frankwillmore closed 6 years ago

frankwillmore commented 7 years ago

minor mod to stopall.sh which waits on pid instead of sleeping

jreadey commented 7 years ago

Does this really work? I wasn't too happy with the original approach when I wrote it, but runall.sh is calling run.sh. Since run.sh stop is calling docker stop <name> &, can't the run.sh background job still finish before the docker containers are shut down?

frankwillmore commented 7 years ago

You're right... I didn't realize run.sh was launching background jobs. I added a line to wait on any outstanding jobs: for job in jobs | awk '{print $1}' | sed -e "s/\[//" |sed -e "s/\]//" | sed -e "s/[+-]//"; do wait %$job 2>/dev/null; done

It ain't pretty but it works. I mostly was just making sure I knew how to do pull request on github. :-)