From 6792dcd23cfd5083fd5cd3a1b81d6bc6a0cd6782 Mon Sep 17 00:00:00 2001 From: alexgo Date: Fri, 22 Aug 2014 17:22:47 -0700 Subject: [PATCH] add upstart script --- deploy/latency.conf | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 deploy/latency.conf 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