Created
September 25, 2014 10:46
-
-
Save benevans/346cf56f7464e1ee6e3f to your computer and use it in GitHub Desktop.
Artifactory start script for supervisord
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
#!/bin/bash | |
# Artifactory start script for supervisord | |
# Derived from http://serverfault.com/questions/425132/controlling-tomcat-with-supervisor | |
ARTHOME=$HOME/artifactory-3.3.1 | |
function shutdown() { | |
echo "$(date): Shutting down Artifactory" | |
$ARTHOME/bin/artifactory.sh stop | |
} | |
echo "$(date): Starting Artifactory" | |
$ARTHOME/bin/artifactory.sh start | |
# These signals from supervisord will trigger shutdown | |
trap shutdown HUP INT QUIT ABRT KILL ALRM TERM TSTP | |
ARTPID=$(cat $ARTHOME/run/artifactory.pid) | |
echo "Waiting for $ARTPID" | |
# Tomcat process isn't a direct child of this script, so can't use | |
# wait $ARTPID. Instead just poll the process /proc file. | |
while [ -e /proc/$ARTPID ]; do | |
sleep 2 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment