Created
June 29, 2015 11:06
-
-
Save baniol/dba3f46d156c977beaaf to your computer and use it in GitHub Desktop.
upstart script
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
#!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 |
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
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