2012-10-12 16:37:57 +04:00
#!/bin/bash
#
2017-10-25 18:02:31 +03:00
# Copyright (C) 2012-2017 Red Hat, Inc. All rights reserved.
2012-10-12 16:37:57 +04:00
#
# 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,
2016-01-21 13:49:46 +03:00
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2012-10-12 16:37:57 +04:00
#
2016-11-25 13:30:48 +03:00
# This script is responsible for executing blkdeactivate at shutdown
# to properly unmount filesystems and deactivate device stacks containing
# device-mapper devices (including plain device-mapper devices, LVM2 and
# multipath devices) and MD devices.
2012-10-12 16:37:57 +04:00
#
2012-10-15 16:50:17 +04:00
# chkconfig: 12345 25 75
2012-10-12 16:37:57 +04:00
# description: Controls availability of block devices
#
# For Red-Hat-based distributions such as Fedora, RHEL, CentOS.
#
### BEGIN INIT INFO
# Provides: blk-availability
# Required-Start:
# Required-Stop:
# Default-Start: 1 2 3 4 5
# Default-Stop: 0 6
# Short-Description: Availability of block devices
### END INIT INFO
. /etc/init.d/functions
script=blkdeactivate
2017-10-25 18:08:00 +03:00
sbindir=@SBINDIR@
options="-u -l wholevg -m disablequeueing -r wait"
2012-10-12 16:37:57 +04:00
2017-10-25 18:08:00 +03:00
LOCK_FILE="@DEFAULT_LOCK_DIR@/subsys/blk-availability"
2012-10-12 16:37:57 +04:00
case "$1" in
start)
2017-10-25 18:02:31 +03:00
touch "$LOCK_FILE"
2012-10-12 16:37:57 +04:00
;;
stop)
2017-10-25 18:02:31 +03:00
action "Stopping block device availability:" "$sbindir/$script" $options
rm -f "$LOCK_FILE"
2012-10-12 16:37:57 +04:00
;;
status)
;;
*)
echo $"Usage: $0 {start|stop|status}"
;;
esac