Skip to content

Instantly share code, notes, and snippets.

@pjv
Last active January 18, 2016 18:04
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save pjv/2e9ab32d8d9884bf79a4 to your computer and use it in GitHub Desktop.
Save pjv/2e9ab32d8d9884bf79a4 to your computer and use it in GitHub Desktop.
Ubuntu 14.04 upstart script for HHVM
# hhvm - HipHop VM
#
# The HipHopVM server provides a high performance PHP stack and web server.
# modified by pjv from original found here: http://stackoverflow.com/questions/19013516/upstart-script-for-hhvm-hiphop
description "HHVM server"
author "pjv https://gist.github.com/pjv/2e9ab32d8d9884bf79a4"
start on filesystem or runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 10 5
umask 022
# Location of config and executable
env SERVER=/usr/bin/hhvm
env SERVER_CONFIG_FILE="/etc/hhvm/server.ini"
env PHP_CONFIG_FILE="/etc/hhvm/php.ini"
env RUN_AS=www-data
pre-start script
if [ ! -d /var/run/hhvm ]; then
mkdir -p -m0755 /var/run/hhvm
chown $RUN_AS:$RUN_AS /var/run/hhvm
fi
end script
exec $SERVER --mode daemon --config $PHP_CONFIG_FILE --config $SERVER_CONFIG_FILE --user $RUN_AS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment