diff --git a/rgmanager/src/resources/bind-mount.sh b/rgmanager/src/resources/bind-mount.sh index 47bcccb85..077e0a386 100755 --- a/rgmanager/src/resources/bind-mount.sh +++ b/rgmanager/src/resources/bind-mount.sh @@ -1,157 +1,167 @@ #!/bin/bash # # Copyright Red Hat Inc., 2014 # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2, or (at your option) any # later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 675 Mass Ave, Cambridge, # MA 02139, USA. # # # Bind mount script - mounts parent file system -o bind in another # location # LC_ALL=C LANG=C PATH=/bin:/sbin:/usr/bin:/usr/sbin export LC_ALL LANG PATH . $(dirname $0)/ocf-shellfuncs . $(dirname $0)/utils/fs-lib.sh export IS_BIND_MOUNT=1 export OCF_RESKEY_use_findmnt=0 export OCF_RESKEY_options="bind" export OCF_RESKEY_device="$OCF_RESKEY_source" rv=0 do_metadata() { cat < 1.0 Defines a bind mount. Defines a bind mount. - + + + Symbolic name for this bind mount. + + + Bind Mount Name + + + + + Target of this bind mount Target mountpoint - + Source of the bind mount Source of the bind mount If set, the cluster will kill all processes using this file system when the resource group is stopped. Otherwise, the unmount will fail, and the resource group will be restarted. Force Unmount EOT } verify_source() { if [ -z "$OCF_RESKEY_source" ]; then ocf_log err "No source specified." return $OCF_ERR_ARGS fi [ -d "$OCF_RESKEY_source" ] && return 0 ocf_log err "$OCF_RESKEY_source is not a directory" return $OCF_ERR_ARGS } verify_mountpoint() { if [ -z "$OCF_RESKEY_mountpoint" ]; then ocf_log err "No target path specified." return $OCF_ERR_ARGS fi [ -d "$OCF_RESKEY_mountpoint" ] && return 0 mkdir -p $OCF_RESKEY_mountpoint && return 0 ocf_log err "$OCF_RESKEY_mountpoint is not a directory and could not be created" return $OCF_ERR_ARGS } do_validate() { declare -i ret=0 verify_source || ret=$OCF_ERR_ARGS verify_mountpoint || ret=$OCF_ERR_ARGS return $ret } do_pre_mount() { do_validate || exit $OCF_ERR_ARGS } main $*