summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Kozina <okozina@redhat.com>2015-05-07 15:01:11 +0200
committerOndrej Kozina <okozina@redhat.com>2015-05-07 15:50:30 +0200
commit6cafe391da2f80963806a2cabea8507ec03366af (patch)
treea753f18da22d09674fbcbab71e64eb7d171d1d52
parent561b235914f0810dcdc642061cde1b3dd8136d05 (diff)
downloadlvm2-6cafe391da2f80963806a2cabea8507ec03366af.tar.gz
scripts: add lvmpolld init script
-rw-r--r--configure.in1
-rw-r--r--scripts/lvm2_lvmpolld_init_red_hat.in114
2 files changed, 115 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 2a9aeab1e..18877575f 100644
--- a/configure.in
+++ b/configure.in
@@ -1908,6 +1908,7 @@ scripts/lvm2_cmirrord_systemd_red_hat.service
scripts/lvm2_lvmetad_init_red_hat
scripts/lvm2_lvmetad_systemd_red_hat.service
scripts/lvm2_lvmetad_systemd_red_hat.socket
+scripts/lvm2_lvmpolld_init_red_hat
scripts/lvm2_lvmpolld_systemd_red_hat.service
scripts/lvm2_lvmpolld_systemd_red_hat.socket
scripts/lvm2_monitoring_init_red_hat
diff --git a/scripts/lvm2_lvmpolld_init_red_hat.in b/scripts/lvm2_lvmpolld_init_red_hat.in
new file mode 100644
index 000000000..0a03f01c7
--- /dev/null
+++ b/scripts/lvm2_lvmpolld_init_red_hat.in
@@ -0,0 +1,114 @@
+#!/bin/bash
+#
+# Copyright (C) 2015 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 LVM poll daemon
+#
+# For Red-Hat-based distributions such as Fedora, RHEL, CentOS.
+#
+### BEGIN INIT INFO
+# Provides: lvm2-lvmpolld
+# Required-Start: $local_fs
+# Required-Stop: $local_fs
+# Default-Start: 1 2 3 4 5
+# Default-Stop: 0 6
+# Short-Description: A daemon that is responsible for monitoring in-progress
+# and possibly longer term operations on logical volumes.
+# It helps to reduce the number of spawned processes if same
+# logical volume is requested to get monitored multiple times.
+# Also avoids unsolicited termination due to external factors.
+### END INIT INFO
+
+. /etc/init.d/functions
+
+DAEMON=lvmpolld
+
+exec_prefix=@exec_prefix@
+sbindir=@sbindir@
+
+LOCK_FILE="/var/lock/subsys/$DAEMON"
+PID_FILE="@LVMPOLLD_PIDFILE@"
+
+rh_status() {
+ status -p $PID_FILE $DAEMON
+}
+
+rh_status_q() {
+ rh_status >/dev/null 2>&1
+}
+
+start()
+{
+ ret=0
+ action "Starting LVM poll daemon:" $DAEMON || ret=$?
+ return $ret
+}
+
+
+stop()
+{
+ ret=0
+ action "Signaling LVM poll daemon to exit:" killproc -p $PID_FILE $DAEMON -TERM || ret=$?
+ return $ret
+}
+
+rtrn=1
+
+# See how we were called.
+case "$1" in
+ start)
+ rh_status_q && exit 0
+ start
+ rtrn=$?
+ [ $rtrn = 0 ] && touch $LOCK_FILE
+ ;;
+
+ stop|force-stop)
+ rh_status_q || exit 0
+ stop
+ rtrn=$?
+ [ $rtrn = 0 ] && rm -f $LOCK_FILE
+ ;;
+
+ restart)
+ if stop
+ then
+ start
+ fi
+ rtrn=$?
+ ;;
+
+ condrestart|try-restart)
+ rh_status_q || exit 0
+ if stop
+ then
+ start
+ fi
+ rtrn=$?
+ ;;
+
+ status)
+ rh_status
+ rtrn=$?
+ ;;
+
+ *)
+ echo $"Usage: $0 {start|stop|force-stop|restart|condrestart|try-restart|status}"
+ ;;
+esac
+
+exit $rtrn