-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |