Skip to content

Instantly share code, notes, and snippets.

@8kigai
Created October 23, 2015 17:32
Show Gist options
  • Save 8kigai/40fea83e12d2c4743d51 to your computer and use it in GitHub Desktop.
Save 8kigai/40fea83e12d2c4743d51 to your computer and use it in GitHub Desktop.
HHVM KeepAlive - Run this script with a minutely cron job to keep HHVM alive. This script is suited for use with debian, or debian flavored distros. Today, when HHVM crashes or segfaults, the process dies, causing your site to go down for an unprecedented amount of time - until you reboot (if HHVM starts on boot) or restart it manually. Use this…
#!/bin/bash
## Install the cron job below by running crontab -e to make the script run every minute ##
## */1 * * * * bash /change/to/file/path/hhvm.sh ##
#
if ps aux | grep -q "[h]hvm"; then
/etc/init.d/hhvm start
else
:
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment