view scripts/server-ctl @ 2806:845e87d5e3ba

translator objects now have the following search path: - selected locale messages in the tracker locale dir - selected locale messages in the system locale dir - english messages in the tracker locale dir - english messages in the system locale dir automatically compile .mo files if needed (found .po file and .mo is missing or .po mtime is greater that .mo mtime) removed support for python < 2.0. gettext module is now required. get_translation: removed 'domain' argument, added 'tracker_home' argument
author Alexander Smishlajev <a1s@users.sourceforge.net>
date Sat, 23 Oct 2004 14:03:34 +0000
parents adc076b825a1
children 311ad623e2d1
line wrap: on
line source

#!/bin/sh

#
# Configuration
# 
PORT=8080
PIDFILE="/usr/local/roundup/var/roundup-server.pid"
LOGFILE="/usr/local/roundup/var/roundup-server.log"
OTHERARGS=""
TRACKERS="cg=/usr/local/roundup/trackers/cg"

SERVER="/usr/local/bin/roundup-server -l ${LOGFILE} -d ${PIDFILE} -p ${PORT} ${OTHERARGS} ${TRACKERS}"
ERROR=0
ARGV="$@"
if [ "x$ARGV" = "x" ] ; then 
    ARGS="help"
fi

for ARG in $@ $ARGS
do
    # check for pidfile
    if [ -f $PIDFILE ] ; then
	PID=`cat $PIDFILE`
	if [ "x$PID" != "x" ] && kill -0 $PID 2>/dev/null ; then
	    STATUS="roundup-server (pid $PID) running"
	    RUNNING=1
	else
	    STATUS="roundup-server (pid $PID?) not running"
	    RUNNING=0
	fi
    else
	STATUS="roundup-server (no pid file) not running"
	RUNNING=0
    fi

    case $ARG in
    start)
	if [ $RUNNING -eq 1 ] ; then
	    echo "$0 $ARG: roundup-server (pid $PID) already running"
	    continue
	fi
	if $SERVER ; then
	    echo "$0 $ARG: roundup-server started"
	else
	    echo "$0 $ARG: roundup-server could not be started"
	    ERROR=1
	fi
	;;
    condstart)
	if [ $RUNNING -eq 1 ] ; then
	    continue
	fi
	if $SERVER ; then
	    echo "$0 $ARG: roundup-server started"
	else
	    echo "$0 $ARG: roundup-server could not be started"
	    ERROR=1
	fi
	;;
    stop)
	if [ $RUNNING -eq 0 ] ; then
	    echo "$0 $ARG: $STATUS"
	    continue
	fi
	if kill $PID ; then
	    echo "$0 $ARG: roundup-server stopped"
	else
	    echo "$0 $ARG: roundup-server could not be stopped"
	    ERROR=2
	fi
	;;
    status)
	echo $STATUS
	;;
    *)
	echo "usage: $0 (start|condstart|stop|status)"
	cat <<EOF

    start      - start roundup-server
    condstart  - start roundup-server if it's not running
    stop       - stop roundup-server
    status     - display roundup-server status

EOF
	ERROR=3
    ;;

    esac

done

exit $ERROR


Roundup Issue Tracker: http://roundup-tracker.org/