diff -Nru hellodeb-0.2.10/debian/changelog hellodeb-0.2.11/debian/changelog --- hellodeb-0.2.10/debian/changelog 2016-04-27 22:51:02.000000000 +0000 +++ hellodeb-0.2.11/debian/changelog 2016-04-28 01:19:27.000000000 +0000 @@ -1,3 +1,9 @@ +hellodeb (0.2.11) trusty; urgency=medium + + * Added hellodeb.upstart, hope it works. + + -- Michal Migurski Wed, 27 Apr 2016 18:18:38 -0700 + hellodeb (0.2.10) trusty; urgency=medium * Trying /usr/local/nodejs instead of /usr/local/node_modules. diff -Nru hellodeb-0.2.10/debian/hellodeb.upstart hellodeb-0.2.11/debian/hellodeb.upstart --- hellodeb-0.2.10/debian/hellodeb.upstart 1970-01-01 00:00:00.000000000 +0000 +++ hellodeb-0.2.11/debian/hellodeb.upstart 2016-04-28 01:12:49.000000000 +0000 @@ -0,0 +1,38 @@ +# +#!upstart +# using upstart http://upstart.ubuntu.com/getting-started.html and node forever https://github.com/nodejitsu/forever/ +# to run server +# redhat has additional sudo restrictions, you must comment out 'Default requiretty' from /etc/sudoers +#startup monitoring script derived from http://stackoverflow.com/questions/11084279/node-js-setup-for-easy-deployment-and-updating + +description "node.js server" +author "jujhar" +env PROGRAM_NAME="pelias" +env FULL_PATH="/usr/lib/nodejs/hellodeb" +env FILE_NAME="hello.js" +env NODE_PATH="/usr/bin/node" +env USERNAME="root" + +start on startup +stop on shutdown + +script + export HOME="/root" + export NODE_ENV=staging #development/staging/production + + echo $$ > /var/run/$PROGRAM_NAME.pid + cd $FULL_PATH + #exec sudo -u $USERNAME $NODE_PATH $FULL_PATH/$FILE_NAME >> /var/log/$PROGRAM_NAME.sys.log 2>&1 + exec $NODE_PATH $FULL_PATH/$FILE_NAME >> /var/log/$PROGRAM_NAME.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/$PROGRAM_NAME.sys.log +end script + +pre-stop script + rm /var/run/$PROGRAM_NAME.pid + echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Stopping" >> /var/log/$PROGRAM_NAME.sys.log +end script +