Skip to content

Instantly share code, notes, and snippets.

@paydro
Created May 16, 2012 20:58
Monit wrapper script that start/stops a process that doesn't use a pid
#!/usr/bin/env bash
case $1 in
start)
PID=$(start statsd | awk '{print $4}');
echo $PID > /var/run/statsd.pid;
;;
stop)
kill `cat /var/run/statsd.pid` ;;
*)
echo "usage: statsd_wrapper {start|stop}" ;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment