Skip to content

Instantly share code, notes, and snippets.

@pjv
Last active January 18, 2016 18:04
Show Gist options
  • Select an option

  • Save pjv/2e9ab32d8d9884bf79a4 to your computer and use it in GitHub Desktop.

Select an option

Save pjv/2e9ab32d8d9884bf79a4 to your computer and use it in GitHub Desktop.

Revisions

  1. pjv revised this gist Nov 24, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion hhvm.conf
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@
    # modified by pjv from original found here: http://stackoverflow.com/questions/19013516/upstart-script-for-hhvm-hiphop

    description "HHVM server"
    author "pjv"
    author "pjv https://gist.github.com/pjv/2e9ab32d8d9884bf79a4"

    start on filesystem or runlevel [2345]
    stop on runlevel [!2345]
  2. pjv created this gist Nov 24, 2014.
    29 changes: 29 additions & 0 deletions hhvm.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    # 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"

    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