Skip to content

Instantly share code, notes, and snippets.

@gkspranger
Created February 17, 2017 20:53
Show Gist options
  • Save gkspranger/537b6017a494f54010f0bf401e75dd55 to your computer and use it in GitHub Desktop.
Save gkspranger/537b6017a494f54010f0bf401e75dd55 to your computer and use it in GitHub Desktop.
#!/bin/bash
# our AEM app runs as the 'day' user in the /home/day DIR
## for you yungins, 'day' is the company that created cq5/aem6
# MUST RUN THIS as the day user
# {{ aem_type }} is the AEM instance type we store in Ansible .. author or publish
PID=$(ps aux | egrep "day.*java" | egrep -v "egrep" | awk '{print $2}')
LOG="/home/day/{{ aem_type }}/crx-quickstart/logs/threaddump.log"
# clear out old log file
echo "" > $LOG
echo "logging thread dump to $LOG"
for i in {1..10}
do
echo "taking thread dump #${i}"
jstack $PID >> $LOG
sleep 5
done
echo "all done .. have a nice day"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment