Skip to content

Instantly share code, notes, and snippets.

@paydro
Created May 16, 2012 20:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paydro/2713905 to your computer and use it in GitHub Desktop.
Save paydro/2713905 to your computer and use it in GitHub Desktop.
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