summaryrefslogtreecommitdiffstats
path: root/scripts/lvm2_monitoring_init_rhel4
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2007-01-24 23:43:27 +0000
committerAlasdair Kergon <agk@redhat.com>2007-01-24 23:43:27 +0000
commit20db8ffcaef468b884f1cbf1193bc38a2d4f9f05 (patch)
treecaa5cb06a7acba396c04e1adfc8775c86f19102e /scripts/lvm2_monitoring_init_rhel4
parent24f4552bbe87bd154bd2e3622cd2a0886470468a (diff)
downloadlvm2-20db8ffcaef468b884f1cbf1193bc38a2d4f9f05.tar.gz
lvm2-20db8ffcaef468b884f1cbf1193bc38a2d4f9f05.tar.xz
lvm2-20db8ffcaef468b884f1cbf1193bc38a2d4f9f05.zip
lvm.static no longer interacts with dmeventd unless explicitly asked to.
Diffstat (limited to 'scripts/lvm2_monitoring_init_rhel4')
-rw-r--r--scripts/lvm2_monitoring_init_rhel498
1 files changed, 98 insertions, 0 deletions
diff --git a/scripts/lvm2_monitoring_init_rhel4 b/scripts/lvm2_monitoring_init_rhel4
new file mode 100644
index 00000000..3f2360d7
--- /dev/null
+++ b/scripts/lvm2_monitoring_init_rhel4
@@ -0,0 +1,98 @@
+#!/bin/bash
+#
+# Copyright (C) 2007 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# This file is part of LVM2.
+# It is required for the proper handling of failures of LVM2 mirror
+# devices that were created using the -m option of lvcreate.
+#
+#
+# chkconfig: 12345 02 99
+# description: Starts and stops dmeventd monitoring for lvm2
+#
+### BEGIN INIT INFO
+# Provides:
+### END INIT INFO
+
+. /etc/init.d/functions
+
+VGCHANGE="/usr/sbin/vgchange"
+
+start()
+{
+ for ret in 0
+ do
+ # TODO do we want to separate out already active groups only?
+ VGS=`vgs --noheadings -o name`
+ for vg in $VGS
+ do
+ if ! action "Starting monitoring for VG $vg:" $VGCHANGE --monitor y $vg
+ then
+ ret=$?
+ fi
+ done
+
+ done
+
+ return $ret
+}
+
+
+stop()
+{
+ for ret in 0
+ do
+ # TODO do we want to separate out already active groups only?
+ VGS=`vgs --noheadings -o name`
+ for vg in $VGS
+ do
+ if ! action "Starting monitoring for VG $vg:" $VGCHANGE --monitor n $vg
+ then
+ ret=$?
+ fi
+ done
+
+ done
+
+}
+
+ret=1
+
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ret=$?
+ ;;
+
+ stop)
+ stop
+ ret=$?
+ ;;
+
+ restart)
+ if stop
+ then
+ start
+ fi
+ ret=$?
+ ;;
+
+ status)
+ # TODO anyone with an idea how to dump monitored volumes?
+ ;;
+
+ *)
+ echo $"Usage: $0 {start|stop|restart|status}"
+ ;;
+esac
+
+exit $ret