Monotone-Parent: 4c5d2c4066a223a058bf92270c21c3319e0a25fc

Monotone-Revision: 7c3174b2dda8eadea001bf8ed529fc682f44b4eb

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2009-11-12T18:30:21
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2009-11-12 18:30:21 +00:00
parent ff1496649f
commit 83c23e05fc
8 changed files with 2387 additions and 484 deletions

View File

@ -1,9 +1,9 @@
Alias /sogo.woa/WebServerResources/ \
/usr/lib/GNUstep/SOGo/WebServerResources/
Alias /SOGo.woa/WebServerResources/ \
/usr/lib/GNUstep/SOGo/WebServerResources/
Alias /SOGO.woa/WebServerResources/ \
/usr/lib/GNUstep/SOGo/WebServerResources/
/usr/lib/GNUstep/SOGo/WebServerResources/
Alias /SOGo/WebServerResources/ \
/usr/lib/GNUstep/SOGo/WebServerResources/
AliasMatch /SOGo/so/ControlPanel/Products/(.*)/Resources/(.*) \
/usr/lib/GNUstep/SOGo/$1.SOGo/Resources/$2
<LocationMatch "^/SOGo/so/ControlPanel/Products/.*UI/Resources/.*jpg">
SetHandler default-handler
@ -25,13 +25,24 @@ Alias /SOGO.woa/WebServerResources/ \
SetHandler default-handler
</LocationMatch>
AliasMatch /SOGo/so/ControlPanel/Products/(.*)/Resources/(.*) \
/usr/lib/GNUstep/SOGo/$1.SOGo/Resources/$2
## Uncomment the following to enable proxy-side authentication, you will then
## need to set the "SOGoTrustProxyAuthentication" SOGo user default to YES and
## adjust the "x-webobjects-remote-user" proxy header in the "Proxy" section
## below.
#<Location /SOGo>
# AuthType XXX
# Require valid-user
# SetEnv proxy-nokeepalive 1
# Allow from all
#</Location>
<Proxy balancer://sogocluster>
RequestHeader set "x-webobjects-server-protocol" "HTTP/1.0"
RequestHeader set "x-webobjects-remote-host" "127.0.0.1"
ProxyRequests Off
SetEnv proxy-nokeepalive 1
ProxyPreserveHost On
ProxyPassInterpolateEnv On
ProxyPass /SOGo http://127.0.0.1:20000/SOGo interpolate
<Proxy http://127.0.0.1:20000/SOGo>
## adjust the following to your configuration
RequestHeader set "x-webobjects-server-port" "443"
RequestHeader set "x-webobjects-server-name" "yourhostname"
@ -41,18 +52,9 @@ AliasMatch /SOGo/so/ControlPanel/Products/(.*)/Resources/(.*) \
## adjust the following line:
# RequestHeader set "x-webobjects-remote-user" "%{REMOTE_USER}e"
BalancerMember http://127.0.0.1:20000 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
RequestHeader set "x-webobjects-server-protocol" "HTTP/1.0"
RequestHeader set "x-webobjects-remote-host" "127.0.0.1"
Order allow,deny
Allow from all
</Proxy>
SetEnv proxy-nokeepalive 1
ProxyRequests Off
ProxyPass /SOGo balancer://sogocluster/SOGo

View File

@ -7,11 +7,11 @@ AliasMatch /SOGo/so/ControlPanel/Products/(.*)/Resources/(.*) \
## For Debian-based distributions, use the following instead of the above:
# Alias /SOGo.woa/WebServerResources/ \
# /usr/lib/GNUstep/SOGo/WebServerResources/
# /usr/lib/GNUstep/SOGo/WebServerResources/
# Alias /SOGo/WebServerResources/ \
# /usr/lib/GNUstep/SOGo/WebServerResources/
# /usr/lib/GNUstep/SOGo/WebServerResources/
# AliasMatch /SOGo/so/ControlPanel/Products/(.*)/Resources/(.*) \
# /usr/lib/GNUstep/SOGo/$1.SOGo/Resources/$2
# /usr/lib/GNUstep/SOGo/$1.SOGo/Resources/$2
<LocationMatch "^/SOGo/so/ControlPanel/Products/.*UI/Resources/.*jpg">
SetHandler default-handler
@ -47,12 +47,10 @@ AliasMatch /SOGo/so/ControlPanel/Products/(.*)/Resources/(.*) \
ProxyRequests Off
SetEnv proxy-nokeepalive 1
ProxyPreserveHost On
ProxyPass /SOGo balancer://sogocluster/SOGo
<Proxy balancer://sogocluster>
RequestHeader set "x-webobjects-server-protocol" "HTTP/1.0"
RequestHeader set "x-webobjects-remote-host" "127.0.0.1"
ProxyPassInterpolateEnv On
ProxyPass /SOGo http://127.0.0.1:20000/SOGo interpolate
<Proxy http://127.0.0.1:20000/SOGo>
## adjust the following to your configuration
RequestHeader set "x-webobjects-server-port" "443"
RequestHeader set "x-webobjects-server-name" "yourhostname"
@ -62,15 +60,9 @@ ProxyPass /SOGo balancer://sogocluster/SOGo
## adjust the following line:
# RequestHeader set "x-webobjects-remote-user" "%{REMOTE_USER}e"
BalancerMember http://127.0.0.1:20000 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.
## In Debian-based distributions, you should do the same in the
## /etc/default/sogo file instead.
# 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
RequestHeader set "x-webobjects-server-protocol" "HTTP/1.0"
RequestHeader set "x-webobjects-remote-host" "127.0.0.1"
Order allow,deny
Allow from all
</Proxy>

File diff suppressed because it is too large Load Diff

View File

@ -27,31 +27,20 @@
# 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
. /etc/rc.d/init.d/functions
if [ -z "$GNUSTEP_SYSTEM_ROOT" ]
then
. /usr/GNUstep/System/Library/Makefiles/GNUstep.sh
fi
REAL_DAEMON=sogod
DAEMON=/usr/sbin/sogod
NAME=sogod
NAME=sogo
DAEMON=/usr/GNUstep/System/Tools/Admin/sogod
DESC="Scalable OpenGroupware.Org (Inverse edition)"
PIDFILE=/var/run/sogo/sogod.
USER=$NAME
PREFORK=1
if [ -f /etc/sysconfig/sogo ]; then
. /etc/sysconfig/sogo
PIDFILE=/var/run/$NAME/$NAME.pid
LOGFILE=/var/log/$NAME/$NAME.log
if [ -f /etc/sysconfig/$NAME ]; then
. /etc/sysconfig/$NAME
fi
if [ ! -x $DAEMON ]; then
@ -69,114 +58,95 @@ checkDir() {
if [ `/usr/bin/stat "$directory" -c %U` != "$USER" ]
then
echo "$directory is not owned by the sogo user."
echo "$directory is not owned by the '$USER' user."
exit 1
fi
}
checkDir /var/run/sogo
checkDir /var/spool/sogo
checkDir /var/run/$NAME
checkDir /var/spool/$NAME
checkDir /var/log/$NAME
#set -e
. /etc/rc.d/init.d/functions
if [ -z "$GNUSTEP_SYSTEM_ROOT" ]
then
. /usr/GNUstep/System/Library/Makefiles/GNUstep.sh
fi
DAEMON_OPTS="-WOWorkersCount $PREFORK -WOPidFile $PIDFILE -WOLogFile $LOGFILE"
start() {
echo $"Starting $DESC: "
for ((a=1; a <= PREFORK ; a++))
do
ppid="`cat ${PIDFILE}${a} 2> /dev/null`"
if [ -n "$ppid" ]
pid="`cat $PIDFILE 2> /dev/null`"
if [ -n "$pid" ]
then
pid="`ps --pid ${pid} -o pid=`"
if [ -n "$pid" ]
then
ppid="`ps --pid ${ppid} -o pid=`"
if [ -n "$ppid" ]
then
echo " $DAEMON $a already running. Skipped."
else
rm -f ${PIDFILE}${a}
daemon --user="$USER" "$DAEMON" $a
echo " $DAEMON $a (stale pid file removed)"
fi
echo " $NAME already running. Skipped."
else
daemon --user="$USER" "$DAEMON" $a
echo " $DAEMON $a"
rm -f $PIDFILE
daemon --user="$USER" --pidfile="$PIDFILE" "$DAEMON" $DAEMON_OPTS
echo " $NAME (stale pid file removed)"
fi
done
else
daemon --user="$USER" --pidfile="$PIDFILE" "$DAEMON" $DAEMON_OPTS
echo " $NAME"
fi
}
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" ]
pid="`cat $PIDFILE 2> /dev/null`"
if [ -n "$pid" ]
then
pid="`ps --pid ${pid} -o pid=`"
if [ -n "$pid" ]
then
ppid="`ps --pid ${ppid} -o pid=`"
if [ -n "$ppid" ]
if kill $pid >& /dev/null
then
if kill $ppid >& /dev/null
then
echo " $DAEMON $a stopped"
fi
else
echo " $DAEMON $a not running"
sleep 1
pid="`ps --pid ${pid} -o pid=`"
if [ -n "$pid" ]
then
echo " $NAME stopped"
else
kill -9 $pid >& /dev/null
echo " $NAME killed"
fi
rm -f $PIDFILE
fi
else
echo " $DAEMON $a not running"
echo " $NAME 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
else
echo " $NAME not running"
fi
}
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" ]
pid="`cat $PIDFILE 2> /dev/null`"
if [ -n "$pid" ]
then
pid="`ps --pid ${pid} -o pid=`"
if [ -n "$pid" ]
then
ppid="`ps --pid ${ppid} -o pid=`"
if [ -n "$ppid" ]
if kill $pid >& /dev/null
then
kill $ppid >& /dev/null
sleep 1
sleep 1
pid="`ps --pid ${pid} -o pid=`"
if [ -n "$pid" ]
then
kill -9 $pid >& /dev/null
fi
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
daemon --user="$USER" "$DAEMON" $a
echo " $DAEMON $a"
done
fi
daemon --user="$USER" --pidfile="$PIDFILE" "$DAEMON" $DAEMON_OPTS
echo " $NAME"
}
case "$1" in
@ -186,15 +156,15 @@ case "$1" in
stop)
stop
;;
restart|force-reload)
restart)
restart
;;
status)
status $REAL_DAEMON
status -p "$PIDFILE" $DAEMON
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
echo "Usage: $N {start|stop|restart|status}" >&2
exit 1
;;
esac

View File

@ -27,31 +27,20 @@
# 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
NAME=sogo
DAEMON=/usr/GNUstep/System/Tools/Admin/sogod
DESC="Scalable OpenGroupware.Org (Inverse edition)"
PIDFILE=/var/run/sogo/sogod.
USER=$NAME
PREFORK=1
if [ -f /etc/sysconfig/sogo ]; then
. /etc/sysconfig/sogo
PIDFILE=/var/run/$NAME/$NAME.pid
LOGFILE=/var/log/$NAME/$NAME.log
if [ -f /etc/sysconfig/$NAME ]; then
. /etc/sysconfig/$NAME
fi
if [ ! -x $DAEMON ]; then
@ -69,115 +58,95 @@ checkDir() {
if [ `/usr/bin/stat "$directory" -c %U` != "$USER" ]
then
echo "$directory is not owned by the sogo user."
echo "$directory is not owned by the '$USER' user."
exit 1
fi
}
checkDir /var/run/sogo
checkDir /var/spool/sogo
checkDir /var/run/$NAME
checkDir /var/spool/$NAME
checkDir /var/log/$NAME
#set -e
. /lib/lsb/init-functions
if [ -z "$GNUSTEP_SYSTEM_ROOT" ]
then
. /usr/GNUstep/System/Library/Makefiles/GNUstep.sh
fi
DAEMON_OPTS="-WOWorkersCount $PREFORK -WOPidFile $PIDFILE -WOLogFile $LOGFILE"
start() {
echo $"Starting $DESC: "
for ((a=1; a <= PREFORK ; a++))
do
ppid="`cat ${PIDFILE}${a} 2> /dev/null`"
if [ -n "$ppid" ]
pid="`cat $PIDFILE 2> /dev/null`"
if [ -n "$pid" ]
then
pid="`ps --pid ${pid} -o pid=`"
if [ -n "$pid" ]
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
echo " $NAME already running. Skipped."
else
startproc -u "$USER" "$DAEMON" $a
echo " $DAEMON $a"
rm -f $PIDFILE
startproc -u "$USER" -p $PIDFILE "$DAEMON" $DAEMON_OPTS
echo " $NAME (stale pid file removed)"
fi
sleep 1
done
else
startproc -u "$USER" -p $PIDFILE "$DAEMON" $DAEMON_OPTS
echo " $NAME"
fi
}
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" ]
pid="`cat $PIDFILE 2> /dev/null`"
if [ -n "$pid" ]
then
pid="`ps --pid ${pid} -o pid=`"
if [ -n "$pid" ]
then
ppid="`ps --pid ${ppid} -o pid=`"
if [ -n "$ppid" ]
if kill $pid >& /dev/null
then
if kill $ppid >& /dev/null
then
echo " $DAEMON $a stopped"
fi
else
echo " $DAEMON $a not running"
sleep 1
pid="`ps --pid ${pid} -o pid=`"
if [ -n "$pid" ]
then
echo " $NAME stopped"
else
kill -9 $pid >& /dev/null
echo " $NAME killed"
fi
rm -f $PIDFILE
fi
else
echo " $DAEMON $a not running"
echo " $NAME 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
else
echo " $NAME not running"
fi
}
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" ]
pid="`cat $PIDFILE 2> /dev/null`"
if [ -n "$pid" ]
then
pid="`ps --pid ${pid} -o pid=`"
if [ -n "$pid" ]
then
ppid="`ps --pid ${ppid} -o pid=`"
if [ -n "$ppid" ]
if kill $pid >& /dev/null
then
kill $ppid >& /dev/null
sleep 1
sleep 1
pid="`ps --pid ${pid} -o pid=`"
if [ -n "$pid" ]
then
kill -9 $pid >& /dev/null
fi
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
fi
startproc -u "$USER" -p $PIDFILE "$DAEMON" $DAEMON_OPTS
echo " $NAME"
}
case "$1" in
@ -187,15 +156,15 @@ case "$1" in
stop)
stop
;;
restart|force-reload)
restart)
restart
;;
status)
status $REAL_DAEMON
checkproc -p $PIDFILE $DAEMON
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
echo "Usage: $N {start|stop|restart|status}" >&2
exit 1
;;
esac

View File

@ -82,5 +82,4 @@ fi
# echo "SOGOD: $sogod -WOPort $listen" 2>&1
exec $sogod -WOPort $listen >> /var/log/sogo/sogod-$port.log 2>&1 &
echo $! > $PIDFILE
exec $sogod -WOPort $listen -WOLogFile /var/log/sogo/sogod.log -WOPidFile $PIDFILE

170
debian/sogo.init vendored
View File

@ -30,22 +30,20 @@
# 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.
# specify more if you are using a load-balancer
PREFORK=1
SOGO_ARGS=""
USER=sogo
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/sogod-wrapper
NAME=sogod
NAME=sogo
DAEMON=/usr/sbin/sogod
DESC="Scalable OpenGroupware.Org"
PIDFILE=/var/run/sogo/sogod.
USER=$NAME
PREFORK=1
if [ -f /etc/default/sogo ]; then
. /etc/default/sogo
PIDFILE=/var/run/$NAME/$NAME.pid
LOGFILE=/var/log/$NAME/$NAME.log
if [ -f /etc/default/$NAME ]; then
. /etc/default/$NAME
fi
if [ ! -x $DAEMON ]; then
@ -53,128 +51,56 @@ if [ ! -x $DAEMON ]; then
exit 1
fi
if [ `/usr/bin/stat /var/run/sogo -c %U` != $USER ]; then
echo "/var/run/sogo is not owned by the ${USER}."
exit 1
fi
checkDir() {
directory="$1"
if [ ! -d "$directory" ]
then
echo "$directory does not exist."
exit 1
fi
if [ `/usr/bin/stat /var/spool/sogo -c %U` != $USER ]; then
echo "/var/spool/sogo is not owned by the ${USER}."
exit 1
fi
if [ `/usr/bin/stat "$directory" -c %U` != "$USER" ]
then
echo "$directory is not owned by the '$USER' user."
exit 1
if [ `/usr/bin/stat /var/log/sogo -c %U` != $USER ]; then
echo "/var/log/sogo is not owned by the ${USER}."
exit 1
fi
fi
}
checkDir /var/run/$NAME
checkDir /var/spool/$NAME
checkDir /var/log/$NAME
set -e
. /lib/lsb/init-functions
. /usr/share/GNUstep/Makefiles/GNUstep.sh
DAEMON_OPTS="-WOWorkersCount $PREFORK -WOPidFile $PIDFILE -WOLogFile $LOGFILE"
case "$1" in
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 " $NAME $a already running. Skipped."
else
rm -f ${PIDFILE}${a}
start-stop-daemon -c $USER \
-b --start --quiet --exec $DAEMON $a
echo " $NAME $a (stale pid file removed)"
fi
else
start-stop-daemon -c $USER \
-b --start --quiet --exec $DAEMON $a
echo " $NAME $a"
fi
done
echo -n "Starting $DESC: "
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS || true
echo "$NAME."
;;
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 " $NAME $a stopped"
fi
else
echo " $NAME $a not running"
fi
else
echo " $NAME $a not running"
fi
done
echo -n "Stopping $DESC: "
start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON || true
echo "$NAME."
;;
restart)
echo -n "Restarting $DESC: "
start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON || true
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 " $NAME $a killed"
fi
fi
rm -f ${PIDFILE}${a}
done
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS || true
echo "$NAME."
;;
restart|force-reload)
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
start-stop-daemon -c $USER \
-b --start --quiet --exec $DAEMON $a
echo " $NAME $a"
done
status)
status_of_proc -p $PIDFILE "$DAEMON" $NAME && exit 0 || exit $?
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
echo "Usage: $NAME {start|stop|restart|status}" >&2
exit 1
;;
esac

View File

@ -137,7 +137,7 @@ mkdir -p ${RPM_BUILD_ROOT}/var/spool/sogo
cp Apache/SOGo.conf ${RPM_BUILD_ROOT}/etc/httpd/conf.d/
cp Scripts/tmpwatch ${RPM_BUILD_ROOT}/etc/cron.daily/sogo-tmpwatch
cp Scripts/sogo-init.d-redhat ${RPM_BUILD_ROOT}/etc/init.d/sogod
cp Scripts/sogod-wrapper ${RPM_BUILD_ROOT}/usr/sbin/sogod
cp Scripts/sogod-wrapper ${RPM_BUILD_ROOT}/usr/sbin/sogod-wrapper
chmod 755 ${RPM_BUILD_ROOT}/usr/sbin/sogod
chmod 755 ${RPM_BUILD_ROOT}/etc/init.d/sogod
cp Scripts/sogo-default ${RPM_BUILD_ROOT}/etc/sysconfig/sogo