#!/bin/sh
### BEGIN INIT INFO
-# Provides: citadel-server
+# Provides: citadel
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
### END INIT INFO
# Author: Wilfried Goesgens <citadel@outgesourced.org>
+
RUNDIR=/var/run/citadel
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="Citadel Groupware "
NAME=citserver
DAEMON=/usr/sbin/$NAME
+PIDFILE=$RUNDIR/citadel.pid
DAEMON_ARGS=" -d -x3 -lmail -t/dev/null"
-PIDFILE=$RUNDIR/$NAME.pid
SCRIPTNAME=/etc/init.d/citadel
SENDCOMMAND=/usr/sbin/sendcommand
-
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
-# check if we 've got a newer system, so we can do fancy colors and so on.
MODERN=
# Load the VERBOSE setting and other rcS variables
# other if a failure occurred
if $SENDCOMMAND "DOWN" >/dev/null 2>&1 ; then
rm -f $PIDFILE
-
+ count=0;
while test -S /var/run/citadel/citadel.socket; do
+ count=$(($count+1))
sleep 1
echo -n "."
+ if test "$count" = "10"; then
+ killall citserver
+ fi
+ if test "$count" = "20"; then
+ killall -9 citserver
+ rm -rf /var/run/citadel/*
+ fi
done
return 0
else
rm -f $PIDFILE
return 2
fi
-
}
#
fi
;;
*)
- echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2
+ echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
exit 3
;;
esac
-exit 0
\ No newline at end of file
+exit 0