Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > e867d4d95c0187f39824918081a2f075 > files > 3

sympa-6.0-0.b2.3mdv2010.0.i586.rpm

#!/bin/sh
#
# chkconfig: 345 95 05

### BEGIN INIT INFO
# Provides: sympa
# Required-Start: $network mysql
# Required-Stop: $network
# Default-Start: 345
# Short-Description: sympa list manager
# Description: This startup script manages the sympa list manager
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

# Local variables
NAME=sympa
LOCKFILE=/var/lock/subsys/$NAME

start() {
    # Check if it is already running
    if [ ! -f $LOCKFILE ]; then
	gprintf "Starting %s" "$NAME"

	rc=0
	for module in sympa archived bounced task_manager; do
	    /usr/sbin/$module.pl >/dev/null 2>&1
	    rc=$(($rc + $?))
	done

	if [ $rc -eq 0 ]; then
	    success
	    touch $LOCKFILE
	else
	    failure
	fi
	echo
    fi
}

stop() {
    gprintf "Stopping %s" "$NAME"

    rc=0
    for module in bounced archived sympa sympa-distribute sympa-creation task_manager; do
	if [ -f /var/run/sympa/$module.pid ]; then
	    kill -TERM `cat /var/run/sympa/$module.pid` >/dev/null 2>&1
	    rc=$(($rc + $?))
	fi
    done

    if [ $rc -eq 0 ]; then
	success
	rm -f $LOCKFILE
    else
	failure
    fi
    echo
}

restart() {
    stop
    start
}

# See how we were called.
case "$1" in
    start)
	start
	;;
    stop)
	stop
	;;
    restart|reload)
	restart
	;;
    condrestart|condreload)
	if [ -f $LOCKFILE ]; then
	    restart
	fi
	;;
    status)
	for module in sympa archived bounced task_manager; do
	    status $module.pl
	done
	;;
    *)
	gprintf "Usage: %s {start|stop|status|restart}\n" "$0"
	RETVAL=1
	;;
esac

exit $RETVAL