Created
December 29, 2009 08:07
-
-
Save farcaller/265210 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/sh | |
| # | |
| # Wrapper for running Tomcat under launchd | |
| # Required because launchd needs a non-daemonizing process | |
| function shutdown() | |
| { | |
| $CATALINA_HOME/bin/shutdown.sh | |
| /bin/rm $CATALINA_PID | |
| } | |
| function wait_for_death() | |
| { | |
| while /bin/kill -0 $1 2> /dev/null ; do | |
| sleep 2 | |
| done | |
| } | |
| export CATALINA_PID=$CATALINA_HOME/logs/tomcat.pid | |
| $CATALINA_HOME/bin/startup.sh | |
| trap shutdown QUIT ABRT KILL ALRM TERM TSTP | |
| sleep 2 | |
| wait_for_death `cat $CATALINA_PID` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment