3 # glusterfsd GlusterFS Daemon
7 # description: GlusterFS Daemon
10 # Source function library
11 . /etc/rc.d/init.d/functions
14 . /etc/sysconfig/network
17 # Get service config - may override defaults
18 # [ -f /etc/sysconfig/glusterfsd ] && . /etc/sysconfig/glusterfsd
20 # Check that networking is up.
21 if is_yes "${NETWORKING}"; then
22 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
23 msg_network_down glusterfsd
30 test -x /usr/sbin/glusterfsd || exit 0
33 # Check if the service is already running?
34 if [ ! -f /var/lock/subsys/glusterfsd ]; then
35 msg_starting glusterfsd
36 daemon /usr/sbin/glusterfsd -p /var/run/glusterfsd.pid
38 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/glusterfsd
40 msg_already_running glusterfsd
46 if [ -f /var/lock/subsys/glusterfsd ]; then
48 msg_stopping glusterfsd
49 killproc --pidfile /var/run/glusterfsd.pid glusterfsd -TERM
50 rm -f /var/lock/subsys/glusterfsd
51 # Killing remaining GlusterFS volume handling processes"
52 for PID in $(find /var/lib/glusterd/ -type f -name "*.pid" -exec cat {} \;); do
53 msg_stopping "glusterfs volume daemon (${PID})"
54 ## TODO: Find pidfiles instead of pids and use: killproc --pidfile ${PIDFILE} -TERM
59 msg_not_running glusterfsd
64 if [ -f /var/lock/subsys/glusterfsd ]; then
68 msg_not_running glusterfsd
74 # See how we were called.
95 # Listing volume daemons
96 ls -la /var/lib/glusterd/vols/*/run/*.pid
99 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"