70 lines
1.3 KiB
Bash
70 lines
1.3 KiB
Bash
#!/bin/sh
|
|
#
|
|
# glusterfsd Startup script for the glusterfs server
|
|
#
|
|
# chkconfig: - 20 80
|
|
# description: Clustered file-system server
|
|
#
|
|
# processname: glusterfsd
|
|
# config: /etc/glusterfs/glusterfs-server.vol
|
|
# pidfile: /var/run/glusterfsd.pid
|
|
|
|
# Source function library
|
|
. /etc/rc.d/init.d/functions
|
|
|
|
prog="glusterfsd"
|
|
glusterfsd="/usr/sbin/glusterfsd"
|
|
RETVAL=0
|
|
|
|
# Set defaults, then source config for eventual overrides
|
|
GLUSTERFSD_CONFIG="/etc/glusterfs/glusterfs-server.vol"
|
|
GLUSTERFSD_LOGFILE="/var/log/glusterfs/glusterfsd.log"
|
|
GLUSTERFSD_LOGLEVEL="WARNING"
|
|
[ -f /etc/sysconfig/glusterfsd ] && source /etc/sysconfig/glusterfsd
|
|
|
|
start() {
|
|
echo -n $"Starting $prog: "
|
|
daemon $glusterfsd -f ${GLUSTERFSD_CONFIG} -l ${GLUSTERFSD_LOGFILE} -L ${GLUSTERFSD_LOGLEVEL}
|
|
RETVAL=$?
|
|
echo
|
|
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
|
|
return $RETVAL
|
|
}
|
|
|
|
stop() {
|
|
echo -n $"Stopping $prog: "
|
|
killproc $glusterfsd
|
|
RETVAL=$?
|
|
echo
|
|
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
|
|
return $RETVAL
|
|
}
|
|
|
|
case "$1" in
|
|
start)
|
|
start
|
|
;;
|
|
stop)
|
|
stop
|
|
;;
|
|
restart|reload)
|
|
stop
|
|
start
|
|
;;
|
|
condrestart)
|
|
if [ -f /var/lock/subsys/$prog ]; then
|
|
stop
|
|
start
|
|
fi
|
|
;;
|
|
status)
|
|
status $glusterfsd
|
|
RETVAL=$?
|
|
;;
|
|
*)
|
|
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
|
|
RETVAL=1
|
|
esac
|
|
|
|
exit $RETVAL
|