Sophie

Sophie

distrib > Mandriva > 2009.0 > x86_64 > media > main-testing-src > by-pkgid > dd0486ded0790917ca0605ab8ec1479f > files > 7

openafs-1.4.7-5mdv2009.0.src.rpm

#!/bin/sh
#
# chkconfig: 2345 49 51
# description: Starts the AFS server daemon

### BEGIN INIT INFO
# Provides: openafs-server
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 345
# Short-Description: Starts the AFS server daemon
# Description: This startup script starts the AFS server daemon
### END INIT INFO

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

# Source networking configuration
. /etc/sysconfig/network

# Source specific configuration if available
if [ -r /etc/sysconfig/openafs ] ; then
    . /etc/sysconfig/openafs
fi

# Check that networking is up, unless dynroot is activated
[ ${NETWORKING} = "no" -a $DYNROOT != "yes" ] && exit 0

NAME="AFS server daemon"
LOCKFILE=/var/lock/subsys/openafs-server

start() {
    rc=0
    if [ ! -f $LOCKFILE ]; then
	echo -n "Starting $NAME: "

        daemon "bosserver $BOSSERVER_ARGS >/dev/null 2>&1"
        rc=$?
	echo
	[ $rc -eq 0 ] && touch $LOCKFILE
    fi
    return $rc
}

stop() {
    echo -n "Stopping $NAME: "
        
    bos shutdown localhost -wait -localauth >/dev/null 2>&1

    killproc bosserver
    rc=$?
    echo
    [ $rc -eq 0 ] && rm -f $LOCKFILE

    return $rc
}

restart() {
    stop
    start
}

case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    restart)
        restart
        ;;
    condrestart)
	if [ -f $LOCKFILE ]; then
	    restart
	fi
        ;;
    status)
	status bosserver
        ;;
    *)
        echo $"Usage: $0 {start|stop|restart|condrestart|status}"
        exit 1
	;;
esac

exit $?