--- a/Makefile Thu Nov 20 15:25:28 2014 +0100
+++ b/Makefile Tue Nov 22 14:09:19 2022 +0100
@@ -3,6 +3,7 @@
prefix = /usr/local
sbindir = ${prefix}/sbin
crondir = /etc/cron.d
+defaultsdir = /etc/default
DESTDIR =
NAME = verify-drbd
@@ -16,7 +17,9 @@
install -d $(DESTDIR)$(sbindir)
install $(SCRIPT) $(DESTDIR)$(sbindir)/
install -d $(DESTDIR)$(crondir)
- install -m 0644 $(NAME).cron $(DESTDIR)$(crondir)/$(NAME)
+ install -m -x $(NAME).cron $(DESTDIR)$(crondir)/$(NAME)
+ install -d $(DESTDIR)$(defaultsdir)
+ install -m -x $(NAME).rc $(DESTDIR)$(defaultsdir)/$(NAME)
clean:
-rm -f $(NAME) $(NAME).cron
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/verify-drbd.rc Tue Nov 22 14:09:19 2022 +0100
@@ -0,0 +1,6 @@
+#DISK_OPTIONS="--c-plan-ahead=1 --c-fill-target=32M --c-min-rate=0 --c-max-rate=1G"
+#NET_OPTIONS="--verify-alg sha1 --max--buffers=32k"
+RESOURCES=all
+# uncomment "OPTIONS_ONLY='y'" below if you just want to set disk/net options
+# on this peer and initiate actual verification on another drbd peer
+#OPTIONS_ONLY='y'
--- a/verify-drbd.sh Thu Nov 20 15:25:28 2014 +0100
+++ b/verify-drbd.sh Tue Nov 22 14:09:19 2022 +0100
@@ -1,20 +1,25 @@
#!/bin/sh
-VERIFY_ALG='sha1'
-RESOURCES='all'
+DEFAULTS_FILE=/etc/default/verify-drbd
+[ -e $DEFAULTS_FILE ] && . $DEFAULTS_FILE
usage() {
cat <<__U
usage:
- $0 [-v verify-alg] [res ..[res]]
+ $0 [-o] [res ..[res]]
+ $0 -?
+
+ you may override disk and/or net options for verification in $DEFAULTS_FILE
+
__U
}
-while getopts "v:" opt; do
+while getopts "h" opt; do
case $opt in
- v)
- VERIFY_ALG="$OPTARG"
+ h)
+ usage
+ exit 0
;;
\?)
usage
@@ -29,9 +34,9 @@
fi
for r in $RESOURCES; do
- drbdadm -- --c-plan-ahead 1 --c-fill-target 64k disk-options $r
- drbdadm -- --verify-alg $VERIFY_ALG net-options $r
- drbdadm verify $r
+ [ -n "$DISK_OPTIONS" ] && drbdadm -- $DISK_OPTIONS disk-options $r
+ [ -n "$NET_OPTIONS" ] && drbdadm -- $NET_OPTIONS net-options $r
+ [ "$OPTIONS_ONLY" = 'y' ] || drbdadm verify $r
done
for r in $RESOURCES; do