-
-
Save yustein/28a708631c48b14948dd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file should be in /etc/monit/conf.d | |
check process hhvm with pidfile /var/run/hhvm/pid | |
group hhvm | |
# Start program calls our custom script from above | |
start program = "/usr/local/sbin/start_hhvm.sh" | |
stop program = "/usr/sbin/service hhvm stop" | |
if failed unixsocket /var/run/hhvm/hhvm.sock then restart | |
if mem > 400.0 MB for 1 cycles then restart | |
if 5 restarts with 5 cycles then timeout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This file should be saved in /usr/local/sbin | |
# It must exist because sometime a crashed process | |
# leaves a socket behind, rendering it unstartable | |
# So what we do is test whether the socket file | |
# leftover is there and delete it. Also, make sure | |
# this file is executable: $ chmod +x start_hhvm.sh | |
SOCKET=/var/run/hhvm/hhvm.sock | |
if [ -e $SOCKET ]; | |
then | |
rm -f $SOCKET | |
fi | |
/usr/sbin/service hhvm restart | |
exit 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
in start_hhvm.sh
had to change to