4 # description: Starts and stops clvmd
6 # For Red-Hat-based distributions such as Fedora, RHEL, CentOS.
10 # Required-Start: $local_fs
11 # Required-Stop: $local_fs
14 # Short-Description: Clustered LVM Daemon
17 .
/etc
/init.d
/functions
22 sbindir
=${exec_prefix}/sbin
24 LVDISPLAY
=${sbindir}/lvdisplay
25 VGCHANGE
=${sbindir}/vgchange
26 VGSCAN
=${sbindir}/vgscan
27 VGDISPLAY
=${sbindir}/vgdisplay
32 [ -f /etc
/sysconfig
/cluster
] && .
/etc
/sysconfig
/cluster
34 [ -n "$CLVMD_CLUSTER_IFACE" ] && CLVMDOPTS
="$CLVMDOPTS -I $CLVMD_CLUSTER_IFACE"
36 LOCK_FILE
="/var/lock/subsys/$DAEMON"
42 if ! pidof
$DAEMON > /dev
/null
44 echo -n "Starting $DAEMON: "
45 daemon
$DAEMON $CLVMDOPTS
54 $VGSCAN > /dev
/null
2>&1
60 action
"Activating VG $vg:" $VGCHANGE -ayl $vg || rtrn
=$?
63 action
"Activating VGs:" $VGCHANGE -ayl || rtrn
=$?
78 action
"Deactivating VG $vg:" $VGCHANGE -anl $vg || rtrn
=$?
81 # Hack to only deactivate clustered volumes
82 clustervgs
=`$VGDISPLAY 2> /dev/null | awk 'BEGIN {RS="VG Name"} {if (/Clustered/) print $1;}'`
83 for vg
in $clustervgs; do
84 action
"Deactivating VG $vg:" $VGCHANGE -anl $vg || rtrn
=$?
88 [ $rtrn -ne 0 ] && break
90 echo -n "Stopping clvm:"
91 killproc
$DAEMON -TERM
103 while [ "$count" -le 10 -a -n "`pidof $DAEMON`" ]
109 if [ `pidof $DAEMON` ]
126 rh_status
>/dev
/null
2>&1
132 # See how we were called.
137 [ $rtrn = 0 ] && touch $LOCK_FILE
143 [ $rtrn = 0 ] && rm -f $LOCK_FILE
156 rh_status_q ||
exit 7
163 vols
=$
( $LVDISPLAY -C --nohead 2> /dev
/null |
awk '($3 ~ /....a./) {print $1}' )
164 echo active volumes
: ${vols:-"(none)"}
168 echo $
"Usage: $0 {start|stop|restart|reload|status}"