Skip to content

Instantly share code, notes, and snippets.

@ngryman
Created October 2, 2012 21:10
Show Gist options
  • Select an option

  • Save ngryman/3823330 to your computer and use it in GitHub Desktop.

Select an option

Save ngryman/3823330 to your computer and use it in GitHub Desktop.

Revisions

  1. ngryman revised this gist Oct 4, 2012. 1 changed file with 0 additions and 5 deletions.
    5 changes: 0 additions & 5 deletions service.conf.sh
    Original file line number Diff line number Diff line change
    @@ -16,8 +16,3 @@ exec sudo -u user -i NODE_ENV=production forever start /home/user/path/to/server
    pre-start script
    echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Starting" >> /home/user/path/to/server/syslog 2>&1
    end script

    # stopping log
    pre-stop script
    echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Stopping" >> /home/user/path/to/server/syslog 2>&1
    end script
  2. ngryman renamed this gist Oct 2, 2012. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. ngryman created this gist Oct 2, 2012.
    23 changes: 23 additions & 0 deletions service.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    #!upstart

    description "your fancy description that no one will see ;)"
    author "Your Name <youremail@fqdn>"

    # start on every run level, 2 is the one on Ubuntu
    start on runlevel [2345]

    # stop on halt, maintenance or reboot
    stop on runlevel [016]

    # start our application with the user `user`
    exec sudo -u user -i NODE_ENV=production forever start /home/user/path/to/server >> /home/user/path/to/server/syslog 2>&1

    # starting log
    pre-start script
    echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Starting" >> /home/user/path/to/server/syslog 2>&1
    end script

    # stopping log
    pre-stop script
    echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Stopping" >> /home/user/path/to/server/syslog 2>&1
    end script