diff --git a/deploy/latency.conf b/deploy/latency.conf new file mode 100644 index 0000000..4ba4fce --- /dev/null +++ b/deploy/latency.conf @@ -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