- # Return
- # 0 if daemon has been stopped
- # 1 if daemon was already stopped
- # 2 if daemon could not be stopped
- # other if a failure occurred
- if $SENDCOMMAND "DOWN" >/dev/null 2>&1 ; then
- if test ! -f "$PIDFILE"; then
- echo Unable to find Citserver. Not running?
- return 1
- fi
- PID=`cat $PIDFILE`
+ if test -S $RUNDIR/citadel.socket; then
+ sendcommand "DOWN" || :
+ fi
+
+ PID=`cat $PIDFILE 2>/dev/null || :`
+ if [ ! -z $PID ]; then