f0830d8
#!/bin/sh
f0830d8
#
f0830d8
# glusterfsd   Startup script for the glusterfs server
f0830d8
#
2b2a891
# chkconfig:   - 20 80
f0830d8
# description: Clustered file-system server
f0830d8
2b2a891
### BEGIN INIT INFO
2b2a891
# Provides: glusterfsd
2b2a891
# Required-Start: $local_fs $network
2b2a891
# Required-Stop: $local_fs $network
2b2a891
# Should-Start: 
2b2a891
# Should-Stop: 
2b2a891
# Default-Start: 
2b2a891
# Default-Stop: 0 1 2 3 4 5 6
2b2a891
# Short-Description: glusterfs server
2b2a891
# Description:       Clustered file-system server
2b2a891
### END INIT INFO
2b2a891
2b2a891
# Source function library.
f0830d8
. /etc/rc.d/init.d/functions
f0830d8
2b2a891
exec="/usr/sbin/glusterfsd"
f0830d8
prog="glusterfsd"
f0830d8
f0830d8
# Set defaults, then source config for eventual overrides
666d4a3
GLUSTERFSD_NOFILE="65536"
2b2a891
2b2a891
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
2b2a891
2b2a891
lockfile=/var/lock/subsys/$prog
f0830d8
f0830d8
start() {
2b2a891
    [ -x $exec ] || exit 5
52a440f
    [ $GLUSTERFSD_CONFIG -a -f $GLUSTERFSD_CONFIG ] || exit 6
2b2a891
    ulimit -n $GLUSTERFSD_NOFILE
2b2a891
    echo -n $"Starting $prog: "
2b2a891
    daemon $exec${GLUSTERFSD_CONFIG+" -f $GLUSTERFSD_CONFIG"}${GLUSTERFSD_LOGFILE+" -l $GLUSTERFSD_LOGFILE"}${GLUSTERFSD_LOGLEVEL+" -L $GLUSTERFSD_LOGLEVEL"} -p /var/run/glusterfsd.pid
2b2a891
    retval=$?
2b2a891
    echo
2b2a891
    [ $retval -eq 0 ] && touch $lockfile
2b2a891
    return $retval
f0830d8
}
f0830d8
f0830d8
stop() {
2b2a891
    echo -n $"Stopping $prog: "
2b2a891
    killproc $prog
2b2a891
    retval=$?
2b2a891
    echo
2b2a891
    [ $retval -eq 0 ] && rm -f $lockfile
2b2a891
    return $retval
2b2a891
}
2b2a891
2b2a891
restart() {
2b2a891
    stop
2b2a891
    start
2b2a891
}
2b2a891
2b2a891
reload() {
2b2a891
    restart
f0830d8
}
f0830d8
2b2a891
force_reload() {
2b2a891
    restart
2b2a891
}
2b2a891
2b2a891
rh_status() {
2b2a891
    status $prog
2b2a891
}
2b2a891
2b2a891
rh_status_q() {
2b2a891
    rh_status &>/dev/null
2b2a891
}
2b2a891
2b2a891
f0830d8
case "$1" in
2b2a891
    start)
2b2a891
        rh_status_q && exit 0
2b2a891
        $1
2b2a891
        ;;
2b2a891
    stop)
2b2a891
        rh_status_q || exit 0
2b2a891
        $1
2b2a891
        ;;
2b2a891
    restart)
2b2a891
        $1
2b2a891
        ;;
2b2a891
    reload)
2b2a891
        rh_status_q || exit 7
2b2a891
        $1
2b2a891
        ;;
2b2a891
    force-reload)
2b2a891
        force_reload
2b2a891
        ;;
2b2a891
    status)
2b2a891
        rh_status
2b2a891
        ;;
2b2a891
    condrestart|try-restart)
2b2a891
        rh_status_q || exit 0
2b2a891
        restart
2b2a891
        ;;
2b2a891
    *)
2b2a891
        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
2b2a891
        exit 2
f0830d8
esac
2b2a891
exit $?
f0830d8