mirror of
https://github.com/ceph/ceph
synced 2025-02-23 19:17:37 +00:00
rbd-nbd: script that can be hooked to quiesce/unquiesce events
Signed-off-by: Mykola Golub <mgolub@suse.com>
This commit is contained in:
parent
1d01295494
commit
6e7d4f963b
31
src/tools/rbd_nbd/rbd-nbd_quiesce
Executable file
31
src/tools/rbd_nbd/rbd-nbd_quiesce
Executable file
@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "$0 $@" >&2
|
||||
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "usage: $0 <dev> <cmd>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dev=$1
|
||||
cmd=$2
|
||||
|
||||
export PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||
|
||||
findmnt -S "${dev}" -fno TARGET |
|
||||
while read mnt; do
|
||||
case "${cmd}" in
|
||||
quiesce)
|
||||
echo "freezing ${mnt}" >&2
|
||||
fsfreeze -f "${mnt}"
|
||||
;;
|
||||
unquiesce)
|
||||
echo "unfreezing ${mnt}" >&2
|
||||
fsfreeze -u "${mnt}"
|
||||
;;
|
||||
*)
|
||||
echo "unknown command ${cmd}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
Loading…
Reference in New Issue
Block a user