Skip to content

Instantly share code, notes, and snippets.

@ai212983
Created March 18, 2015 08:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ai212983/c646b0a46e4a009d18c8 to your computer and use it in GitHub Desktop.
Save ai212983/c646b0a46e4a009d18c8 to your computer and use it in GitHub Desktop.
Killing Tomcat 6 instance by grepping process with its home directory
PID=`ps ux | grep -v grep | grep -F -- "-Dcatalina.home=$CATALINA_HOME" | awk '{print $2}'`
echo "Killing Tomcat with the PID: $PID, using \$CATALINA_HOME: '$CATALINA_HOME'"
kill -9 $PID
@ai212983
Copy link
Author

Pretty useful when running multiple Tomcat instances on same machine, so using CATALINA_PID won't work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment