aboutsummaryrefslogtreecommitdiff
path: root/scripts/rhodecode.conf
blob: 948824c53bcfd596d8d73b9a0509637dc2491715 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Where the real starting happens.
# We need multiple upstart conf since we want multiple RhodeCode instances
# running. The instances are created on the APPINI variables, passed by
# rhodecode-start.conf upstart script.
# Rhodecode instances should not be started nor stoppe using this, but rather
# with rhodecode-start and rhodecode-stop, taht will take care of the instance
# variables.

description "RhodeCode Upstart Job"
author "Milo Casagrande <milo.casagrande@linaro.org>"

respawn
respawn limit 10 5

instance $APPINI
export APPINI

umask 0002

env HOME="/home/rhodecode"
env USER="rhodecode"
env GROUP="rhodecode"
env LOCAL_PY_PATH=".local/lib/python2.7/site-packages/"

limit nofile 4096 65536

script
    PIDFILE="/tmp/rhodecode-$APPINI.pid"
    LOGFILE="/var/log/rhodecode/rhodecode-$APPINI.log"
    CONF_FILE="$HOME/$APPINI"
    PYTHONPATH="$PYTHONPATH:$HOME/$LOCAL_PY_PATH"
    export PYTHONPATH=$PYTHONPATH
    exec paster serve --user=$USER --group=$GROUP --pid-file=$PIDFILE --log-file=$LOGFILE $CONF_FILE
end script

post-stop script
    PIDFILE="/tmp/rhodecode-$APPINI.pid"
    rm -f $PIDFILE
end script