forked from asbjornu/drywall
-
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.
upstart script for our ubuntu server
- Loading branch information
Showing
1 changed file
with
28 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,28 @@ | ||
#!upstart | ||
description "Piratpartiets Medlemsportal" | ||
author "Asbjørn et al" | ||
|
||
start on startup | ||
stop on shutdown | ||
|
||
env APPNAME="medlem.piratpartiet.no" | ||
|
||
script | ||
export HOME="/var/www/$APPNAME" | ||
echo $$ > /var/run/$APPNAME.pid | ||
|
||
/bin/bash <<EOT | ||
cd /var/www/$APPNAME | ||
exec sudo -u drywall /usr/local/bin/npm start >> /var/log/$APPNAME.log | ||
EOT | ||
|
||
end script | ||
|
||
pre-start script | ||
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Starting" >> /var/log/$APPNAME.log | ||
end script | ||
|
||
pre-stop script | ||
rm /var/run/$APPNAME.pid | ||
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Stopping" >> /var/log/$APPNAME.log | ||
end script |