@@ -0,0 +1,28 @@
1+# Monit is configured via /etc/monit/monitrc and /etc/monit/conf-enabled/*
5+# Replace USER in all the monit/* files
6+# Move start.sh and stop.sh out of monit/
7+# Copy this file to /etc/monit/conf-enabled/worker
11+# monit status # see currently running things
12+# monit restart elm-worker # restart the Haskell server
15+# monit quit # quit monit
19+check process nginx with pidfile /var/run/nginx.pid
20+ start program = "systemctl start nginx"
21+ stop program = "systemctl stop nginx"
22+ if failed host worker.elm-lang.org port 443 protocol https and request "/" then restart
25+check process elm-worker with pidfile /home/USER/compiler/worker/worker.pid
26+ start program = "/home/USER/compiler/worker/start.sh" with timeout 60 seconds
27+ stop program = "/home/USER/compiler/worker/stop.sh"
28+ if failed host localhost port 8000 protocol http and request "/" then restart