Skip to content

Commit 797c9b2

Browse files
committed
Upstart configuration file
1 parent 1b6f3b2 commit 797c9b2

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

conf/upstart/birdwatch.conf

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
description "Upstart script for https://github.com/matthiasn/Birdwatch, modified from http://www.agileand.me/blog/posts/play-2-2-x-upstart-init-script"
2+
3+
env USER=bw
4+
env GROUP=www
5+
env APP_HOME=/home/bw/apps/birdwatch-0.3.0
6+
env APP_NAME=birdwatch
7+
env PORT=9000
8+
env BIND_ADDRESS=0.0.0.0
9+
env EXTRA=""
10+
11+
start on (filesystem and net-device-up IFACE=lo)
12+
stop on runlevel [!2345]
13+
14+
respawn
15+
respawn limit 30 10
16+
umask 022
17+
expect daemon
18+
19+
pre-start script
20+
#If improper shutdown and the PID file is left on disk delete it so we can start again
21+
22+
if [ -f $APP_HOME/RUNNING_PID ] && ! ps -p `cat $APP_HOME/RUNNING_PID` > /dev/null ; then
23+
rm $HOME/RUNNING_PID ;
24+
fi
25+
end script
26+
27+
exec start-stop-daemon --pidfile ${APP_HOME}/RUNNING_PID --chdir ${APP_HOME} --chuid $USER:$GROUP --exec ${APP_HOME}/bin/$APP_NAME --background --start -- -Dhttp.port=$PORT -Dhttp.address=$BIND_ADDRESS $EXTRA

0 commit comments

Comments
 (0)