How do I create a PID file for Coldfusion 9?
I'm trying to monitor my Coldfusion 9 server with monit, but it needs a PID file. I see I am supposed to create a 'wrapper' but I am unable to find any information on HOW to create that wrapper.
UPDATE
so these ate the additions I made to the coldfusion init script:
case $ARG in
start)
cfstart
echo `/usr/bin/pgrep -o -f /opt/coldfusion9/runtime/bin/coldfusion9` > /var/run/coldfusion.pid;
;;
stop)
cfstop
rm -rf /var/run/coldfusion.pid
;;
restart)
echo "Restarting ColdFusion 9..."
cfstop
rm -rf /var/run/coldfusion.pid
cfstart
echo `/usr/bin/pgrep -o -f /opt/coldfusion9/runtime/bin/coldfusion9` > /var/run/coldfusion.pid;
;;
and the monit config:
check process coldfusion with pidfile /var/run/coldfusion.pid
start program = "/etc/init.d/coldfusion_9 start" with timeout 30 seconds
stop program = "/etc/init.d/coldfusion_9 stop" with timeout 30 seconds
if cpu > 10% for 1 cycles then alert
if cpu > 80% for 3 cycles then alert
if cpu > 90% for 10 cycles then alert
if cpu > 100% for 3 cycles then alert
if totalmem > 1024.0 MB for 10 cycles then alert
if loadavg(5min) greater than 10 for 8 cycles then alert
if 10 restarts within 10 cycles then alert
group server
[all the alerts are just to keep an eye on it till we know it's working]
It seems to be working, turns up in mmonit, sends alerts on a restart - can anyone see anything wrong with this, or ways to improve?