Skip to content

Instantly share code, notes, and snippets.

@antoniocapelo
Created December 31, 2014 19:16

Revisions

  1. antoniocapelo created this gist Dec 31, 2014.
    24 changes: 24 additions & 0 deletions node-server-service.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    description "task for nodeJS powered site"
    author "António Capelo - antonio.c.capelo@gmail.com"

    # used to be: start on startup
    # until we found some mounts weren't ready yet while booting:
    start on started mountall
    stop on shutdown

    # Automatically Respawn:
    respawn
    respawn limit 99 5

    script
    export HOME="/root"
    export NODE_ENV="production"

    chdir /my/nodejs/server/prod/dir
    exec /usr/local/bin/npm start
    end script

    post-start script
    # Put a script here that will notifiy you node has (re)started
    # /root/bin/hoptoad.sh "node.js has started!"
    end script