]> git.pld-linux.org Git - packages/glusterfs.git/blame - glusterfsd.init
- updated to 3.7.10
[packages/glusterfs.git] / glusterfsd.init
CommitLineData
824dab89
MK
1#!/bin/sh
2#
3# glusterfsd GlusterFS Daemon
4#
5# chkconfig: 345 14 89
6#
7# description: GlusterFS Daemon
8#
9
10# Source function library
11. /etc/rc.d/init.d/functions
12
13# Get network config
14. /etc/sysconfig/network
15
16
17# Get service config - may override defaults
18# [ -f /etc/sysconfig/glusterfsd ] && . /etc/sysconfig/glusterfsd
19
20# Check that networking is up.
21if is_yes "${NETWORKING}"; then
22 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
23 msg_network_down glusterfsd
24 exit 1
25 fi
26else
27 exit 0
28fi
29
30test -x /usr/sbin/glusterfsd || exit 0
31
824dab89 32start() {
d1786ae6
JB
33 # Check if the service is already running?
34 if [ ! -f /var/lock/subsys/glusterfsd ]; then
35 msg_starting glusterfsd
cfcff11b 36 daemon /usr/sbin/glusterfsd -p /var/run/glusterfsd.pid
d1786ae6
JB
37 RETVAL=$?
38 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/glusterfsd
39 else
40 msg_already_running glusterfsd
41 fi
824dab89
MK
42}
43
cfcff11b 44
824dab89 45stop() {
d1786ae6
JB
46 if [ -f /var/lock/subsys/glusterfsd ]; then
47 # Stop daemons.
48 msg_stopping glusterfsd
49 killproc --pidfile /var/run/glusterfsd.pid glusterfsd -TERM
50 rm -f /var/lock/subsys/glusterfsd
cfcff11b
MK
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
55 kill -TERM ${PID}
56 done
57
d1786ae6
JB
58 else
59 msg_not_running glusterfsd
60 fi
824dab89
MK
61}
62
63condrestart() {
d1786ae6
JB
64 if [ -f /var/lock/subsys/glusterfsd ]; then
65 stop
66 start
67 else
68 msg_not_running glusterfsd
69 RETVAL=$1
70 fi
824dab89
MK
71}
72
824dab89
MK
73RETVAL=0
74# See how we were called.
75case "$1" in
76 start)
d1786ae6
JB
77 start
78 ;;
824dab89 79 stop)
d1786ae6
JB
80 stop
81 ;;
824dab89 82 restart)
d1786ae6
JB
83 stop
84 start
85 ;;
824dab89 86 try-restart)
d1786ae6
JB
87 condrestart 0
88 ;;
89 force-reload)
90 condrestart 7
91 ;;
824dab89 92 status)
d1786ae6
JB
93 status glusterfsd
94 RETVAL=$?
cfcff11b
MK
95 # Listing volume daemons
96 ls -la /var/lib/glusterd/vols/*/run/*.pid
d1786ae6 97 ;;
824dab89 98 *)
d1786ae6
JB
99 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
100 exit 3
824dab89
MK
101esac
102
103exit $RETVAL
This page took 0.122759 seconds and 4 git commands to generate.