Last active
February 25, 2019 11:43
-
-
Save NeelamLakra/5f19a1bfc61179b77add7c72dcd8d257 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -x | |
pid=0 | |
sigterm_handler() { | |
echo "sigterm handler called..." | |
if [ $pid -ne 0 ]; then | |
kill -TERM "$pid" | |
echo "scala application terminated..." | |
wait "$pid" | |
fi | |
exit 143; | |
} | |
trap 'kill ${!}; sigterm_handler' TERM | |
#running scala application | |
sbt run & | |
pid="$!" | |
echo "PID=$pid" | |
# wait forever | |
while true | |
do | |
tail -f /dev/null & wait ${!} | |
done | |
set +x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment