Skip to content

Commit

Permalink
add upstart script
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgo committed Aug 23, 2014
1 parent aa7462e commit 6792dcd
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions deploy/latency.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This is an upstart (http://upstart.ubuntu.com/) script
# to run the node.js server on system boot and make it
# manageable with commands such as
#
# This script is to be placed in /etc/init to work with upstart.
#
# Use the following commands to control the upstart script
# sudo status latency
# sudo stop latency
# sudo start latency
# sudo restart latency

description "node.js latency test server"

# When to start the service
start on runlevel [2345]

# When to stop the service
stop on runlevel [06]

# Prepare the environment
pre-start script
mkdir -p /concurix/logs/
end script

# expect fork

# Automatically Respawn:
respawn
respawn limit 99 5

script
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] Starting cx latency service" >> /concurix/logs/latency.log
export NODE_ENV=production
export CX_ENV=beta
cd /concurix/latency-test
exec /usr/local/bin/node /concurix/latency-test/index.js >> /concurix/logs/latency.log 2>&1
end script

0 comments on commit 6792dcd

Please sign in to comment.