Monotone-Parent: b0946b9aef94e9f1deecdb23eaa70b5e1c80f0ae

Monotone-Revision: 6bc80c8b44309025303f41de15a437823b63a030

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2009-04-01T13:38:46
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2009-04-01 13:38:46 +00:00
parent dfa4ca0392
commit 5600334999
3 changed files with 209 additions and 3 deletions

View File

@ -30,8 +30,12 @@ AliasMatch /SOGo/so/ControlPanel/Products/(.*)/Resources/(.*) \
<Proxy balancer://sogocluster>
BalancerMember http://127.0.0.1:20000 retry=1 max=1 timeout=120
BalancerMember http://127.0.0.1:20001 retry=1 max=1 timeout=120
BalancerMember http://127.0.0.1:20002 retry=1 max=1 timeout=120
# If you enable those, don't forget the enable the spawning of multiple SOGo
# processes. With Redhat-based distributions, this is done by setting the
# "PREFORK" variable in /etc/sysconfig/sogo to the amount of processes as
# value.
# BalancerMember http://127.0.0.1:20001 retry=1 max=1 timeout=120
# BalancerMember http://127.0.0.1:20002 retry=1 max=1 timeout=120
ProxySet lbmethod=byrequests maxattempts=1
</Proxy>

View File

@ -0,0 +1,202 @@
#!/bin/bash
# chkconfig: 2345 85 15
# description: SOGo is a groupware server
# processname: sogod
# config: /etc/sysconfig/sogo
# config: /etc/httpd/conf.d/SOGo.conf
# pidfile: /var/run/sogo/sogod.pid
# SOGo init script for SUSE Linux Enterprise Server
#
# Copyright (C) 2007-2009 Inverse inc.
#
# Authors: Wolfgang Sourdeau <wsourdeau@inverse.ca>
# Francis Lachapelle <flachapelle@inverse.ca>
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This file is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
# sogod Scalable OpenGroupware.org (Inverse edition)
PREFORK=1
SOGO_ARGS=""
USER=sogo
PATH=/sbin:/bin:/usr/sbin:/usr/bin
. /lib/lsb/init-functions
if [ -z "$GNUSTEP_SYSTEM_ROOT" ]
then
. /usr/GNUstep/System/Library/Makefiles/GNUstep.sh
fi
REAL_DAEMON=sogod
DAEMON=/usr/sbin/sogod
NAME=sogod
DESC="Scalable OpenGroupware.Org (Inverse edition)"
PIDFILE=/var/run/sogo/sogod.
if [ -f /etc/sysconfig/sogo ]; then
. /etc/sysconfig/sogo
fi
if [ ! -x $DAEMON ]; then
echo "$DAEMON is not executable."
exit 1
fi
checkDir() {
directory="$1"
if [ ! -d "$directory" ]
then
echo "$directory does not exist."
exit 1
fi
if [ `/usr/bin/stat "$directory" -c %U` != "$USER" ]
then
echo "$directory is not owned by the sogo user."
exit 1
fi
}
checkDir /var/run/sogo
checkDir /var/spool/sogo
#set -e
start() {
echo $"Starting $DESC: "
for ((a=1; a <= PREFORK ; a++))
do
ppid="`cat ${PIDFILE}${a} 2> /dev/null`"
if [ -n "$ppid" ]
then
ppid="`ps --pid ${ppid} -o pid=`"
if [ -n "$ppid" ]
then
echo " $DAEMON $a already running. Skipped."
else
rm -f ${PIDFILE}${a}
startproc -u "$USER" "$DAEMON" $a
echo " $DAEMON $a (stale pid file removed)"
fi
else
startproc -u "$USER" "$DAEMON" $a
echo " $DAEMON $a"
fi
done
}
stop() {
echo $"Stopping $DESC: "
su "$USER" -c '/usr/bin/killall gdnc >& /dev/null'
# We kill the parent processes with SIGTERM so that they
# can exit gracefully.
for ((a=1; a <= PREFORK ; a++))
do
ppid="`cat ${PIDFILE}${a} 2> /dev/null`"
if [ -n "$ppid" ]
then
ppid="`ps --pid ${ppid} -o pid=`"
if [ -n "$ppid" ]
then
if kill $ppid >& /dev/null
then
echo " $DAEMON $a stopped"
fi
else
echo " $DAEMON $a not running"
fi
else
echo " $DAEMON $a not running"
fi
done
sleep 1
# We kill the parent and child processes with SIGKILL to make sure they
# really are shutdown, and then we remove their pidfile.
for ((a=1; a <= PREFORK ; a++))
do
ppid="`cat ${PIDFILE}${a} 2> /dev/null`"
if [ -n "$ppid" ]
then
ppid="`ps --pid ${ppid} -o pid= 2> /dev/null`"
if [ -n "$ppid" ]
then
kill -9 $ppid >& /dev/null
pid="`ps --ppid ${ppid} -o pid= 2> /dev/null`"
if [ -n "$pid" ]
then
kill -9 $pid >& /dev/null
fi
echo " $DAEMON $a killed"
fi
fi
rm -f ${PIDFILE}${a}
done
}
restart() {
echo $"Restarting $DESC: "
su "$USER" -c '/usr/bin/killall gdnc >& /dev/null'
for ((a=1; a <= PREFORK ; a++))
do
ppid="`cat ${PIDFILE}${a} 2> /dev/null`"
if [ -n "$ppid" ]
then
ppid="`ps --pid ${ppid} -o pid=`"
if [ -n "$ppid" ]
then
kill $ppid >& /dev/null
sleep 1
fi
ppid="`ps --pid ${ppid} -o pid=`"
if [ -n "$ppid" ]
then
pid="`ps --ppid ${ppid} -o pid=`"
kill -9 $ppid >& /dev/null
kill -9 $pid >& /dev/null
fi
rm -f ${PIDFILE}${a}
fi
startproc -u "$USER" "$DAEMON" $a
echo " $DAEMON $a"
done
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|force-reload)
restart
;;
status)
status $REAL_DAEMON
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
exit 1
;;
esac
exit 0

View File

@ -70,7 +70,7 @@ else
let "port=$startport + $1 - 1"
fi
echo "SOGOD: $sogod" 2>&1
# echo "SOGOD: $sogod" 2>&1
exec $sogod -WOPort $port >> /var/log/sogo/sogod-$port.log 2>&1 &
echo $! > $PIDFILE