Skip to content

Instantly share code, notes, and snippets.

@baniol
Created June 29, 2015 11:06
Show Gist options
  • Save baniol/dba3f46d156c977beaaf to your computer and use it in GitHub Desktop.
Save baniol/dba3f46d156c977beaaf to your computer and use it in GitHub Desktop.
upstart script
#!upstart
description "node.js simple server for loadtesting"
author "mb"
console output
start on started sshd
stop on shutdown
limit nofile 400000 400000
chdir /home/ec2-user/express-loadtests/express-static
script
echo $$ > /var/run/express.pid
exec /usr/bin/node bin/www >> /var/log/express.sys.log 2>&1
end script
pre-start script
# Date format same as (new Date()).toISOString() for consistency
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Starting" >> /var/log/express.sys.log
end script
pre-stop script
rm /var/run/express.pid
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Stopping" >> /var/log/express.sys.log
end script
lauch the service:
`initctl start express-static`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment