7a444f
#!/bin/sh
7a444f
#
7a444f
# glusterd   Startup script for the Ganesha NFS server
7a444f
#
7a444f
# chkconfig:   - 20 80
7a444f
# description: NFSv4 file-system server
7a444f
7a444f
### BEGIN INIT INFO
7a444f
# Provides: nfs-ganesha
7a444f
# Required-Start: $local_fs $network
7a444f
# Required-Stop: $local_fs $network
7a444f
# Should-Start: 
7a444f
# Should-Stop: 
7a444f
# Default-Start: 
7a444f
# Default-Stop: 0 1 2 3 4 5 6
7a444f
# Short-Description: Ganesha NFS server
7a444f
# Description:       NFSv4 file-system server
7a444f
### END INIT INFO
7a444f
7a444f
# Source function library.
7a444f
. /etc/rc.d/init.d/functions
7a444f
7a444f
exe="/usr/sbin/nfs-ganesha.sh"
7a444f
prog="nfs-ganesha"
7a444f
7a444f
# Fedora File System Layout dictates /run
7a444f
[ -e /run ] && RUNDIR="/run"
7a444f
pidf="${RUNDIR:-/var/run}/$prog.pid"
7a444f
7a444f
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
7a444f
7a444f
lockfile=/var/lock/subsys/$prog
7a444f
7a444f
start() {
7a444f
    [ -x $exe ] || exit 5
7a444f
    echo -n $"Starting $prog: "
7a444f
    daemon $exe
7a444f
    retval=$?
7a444f
    echo
7a444f
    [ $retval -eq 0 ] && touch $lockfile
7a444f
    return $retval
7a444f
}
7a444f
7a444f
stop() {
7a444f
    echo -n $"Stopping $prog: "
7a444f
    killproc $prog
7a444f
    retval=$?
7a444f
    echo
7a444f
    [ $retval -eq 0 ] && rm -f $lockfile
7a444f
    return $retval
7a444f
}
7a444f
7a444f
restart() {
7a444f
    stop
7a444f
    start
7a444f
}
7a444f
7a444f
reload() {
7a444f
    restart
7a444f
}
7a444f
7a444f
force_reload() {
7a444f
    restart
7a444f
}
7a444f
7a444f
rh_status() {
7a444f
    status $prog
7a444f
}
7a444f
7a444f
rh_status_q() {
7a444f
    rh_status &>/dev/null
7a444f
}
7a444f
7a444f
7a444f
case "$1" in
7a444f
    start)
7a444f
        rh_status_q && exit 0
7a444f
        $1
7a444f
        ;;
7a444f
    stop)
7a444f
        rh_status_q || exit 0
7a444f
        $1
7a444f
        ;;
7a444f
    restart)
7a444f
        $1
7a444f
        ;;
7a444f
    reload)
7a444f
        rh_status_q || exit 7
7a444f
        $1
7a444f
        ;;
7a444f
    force-reload)
7a444f
        force_reload
7a444f
        ;;
7a444f
    status)
7a444f
        rh_status
7a444f
        ;;
7a444f
    condrestart|try-restart)
7a444f
        rh_status_q || exit 0
7a444f
        restart
7a444f
        ;;
7a444f
    *)
7a444f
        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
7a444f
        exit 2
7a444f
esac
7a444f
exit $?