3
# Required-Start: $local_fs $remote_fs $network
5
# Default-Stop: 0 1 2 6
6
# Short-Description: Loggerhead
7
# Description: Manage Loggerhead (a web viewer for projects in bazaar)
12
# Configure this please:
13
# (Please stop loggerhead before changing the configuration, otherwise this
14
# script might not be able to kill loggerhead)
17
# If serve-branches is not in your path, you will need to specify the full path:
18
SERVE_BRANCHES_CMD=serve-branches
20
LOG_FOLDER=/var/log/loggerhead
21
LOG_FILE=$LOG_FOLDER/loggerheadd.log
22
URL_PREFIX=/loggerhead
25
#please specify the base directory to serve:
28
# You can add additional options to serve-branches here:
29
START_CMD="$SERVE_BRANCHES_CMD --prefix=$URL_PREFIX --log-folder=$LOG_FOLDER --port=$PORT $BZRROOT"
37
pgrep -fl "$START_CMD"
41
proccess=`loggerhead_process`
43
listening=`netstat -nl |grep -e ":$PORT "`
45
if [ -z "$proccess" ]; then
46
echo "Loggerhead is *not* running."
48
echo "Loggerhead is running."
49
if [ -z "$listening" ]; then
50
echo "This server is *not* listening on port $PORT."
52
echo "This server is listening on port $PORT."
58
echo "Starting loggerhead. (See $LOG_FOLDER for details.)"
60
# make sure the log folder is created
63
python $START_CMD > $LOG_FILE 2>&1 &
65
#wait a little while of some logging to appear
67
for i in $(seq 1 3 30); do
69
if [ -n "$log" ]; then
79
echo "Stopping loggerhead."
99
echo "Usage: loggerheadd { start | stop | status | restart }"