ocfs2-tools/ocfs2-tools-suse.diff

119 lines
2.9 KiB
Diff

---
debugfs.ocfs2/Makefile | 5 ++--
vendor/common/o2cb.init | 53 ++++++++++++++++++++++++++++++++++++++++++++---
vendor/common/ocfs2.init | 4 ---
3 files changed, 54 insertions(+), 8 deletions(-)
--- a/debugfs.ocfs2/Makefile
+++ b/debugfs.ocfs2/Makefile
@@ -12,10 +12,11 @@ INCLUDES = -Iinclude -I$(TOPDIR)/libocfs
INCLUDES += $(GLIB_CFLAGS)
ifdef OCFS2_DEBUG
-CFLAGS = -Wall -O -ggdb
+OPTS = -O -ggdb
else
-CFLAGS = -Wall -O2
+OPTS = -O2
endif
+CFLAGS=-Wall $(OPTS)
CFILES = main.c commands.c dump.c utils.c journal.c find_block_inode.c find_inode_paths.c dump_fs_locks.c
--- a/vendor/common/o2cb.init
+++ b/vendor/common/o2cb.init
@@ -6,9 +6,9 @@
#
### BEGIN INIT INFO
# Provides: o2cb
-# Required-Start: $network
-# Should-Start:
-# Required-Stop:
+# Required-Start: $network $syslog $named
+# Should-Start: sshd iscsi
+# Required-Stop: $null
# Default-Start: 2 3 5
# Default-Stop:
# Description: Load O2CB cluster services at system boot.
@@ -151,6 +151,10 @@ O2CB_KEEPALIVE_DELAY_MS=${O2CB_KEEPALIVE
# O2CB_RECONNECT_DELAY_MS: Min time in ms between connection attempts
O2CB_RECONNECT_DELAY_MS=${O2CB_RECONNECT_DELAY_MS}
+# O2CB_HEARTBEAT_MODE: Whether to use the native "kernel" or the "user"
+# driven heartbeat (for example, for integration with heartbeat 2.0.x)
+O2CB_HEARTBEAT_MODE="${O2CB_HEARTBEAT_MODE:-kernel}"
+
EOF
if [ $? != 0 ]
@@ -354,6 +358,34 @@ EOF
read_timeout "network reconnect delay in ms" "$O2CB_RECONNECT_DELAY_MS" "$MIN_RECONNECT_DELAY_MS" "$DEF_RECONNECT_DELAY_MS"
O2CB_RECONNECT_DELAY_MS="$RET_VAL"
+ while :
+ do
+ if [ "$O2CB_HEARTBEAT_MODE" = "user" ]
+ then
+ CUR=y
+ else
+ CUR=n
+ fi
+ echo -n "Use user-space driven heartbeat? (y/n) [$CUR]: "
+ read LINE
+ case "$LINE" in
+ "")
+ break
+ ;;
+ y|Y)
+ O2CB_HEARTBEAT_MODE=user
+ break
+ ;;
+ n|N)
+ O2CB_HEARTBEAT_MODE=kernel
+ break
+ ;;
+ *)
+ echo "Invalid answer: $LINE" >&2
+ ;;
+ esac
+ done
+
# XXX ask about mount point base
}
@@ -707,6 +739,21 @@ load()
eval ${LOAD_ACTIONS[i]}
if_fail "$?"
done
+
+ if [ "$O2CB_HEARTBEAT_MODE" = "user" ] ; then
+ echo -n "Switching to user mode heartbeat : "
+ if modprobe ocfs2_user_heartbeat 2>/dev/null ; then
+ if echo user > /sys/o2cb/heartbeat_mode ; then
+ echo "OK"
+ else
+ echo "FAILED"
+ fi
+
+ else
+ echo "FAILED"
+ fi
+ fi
+
}
load_status()
--- a/vendor/common/ocfs2.init
+++ b/vendor/common/ocfs2.init
@@ -8,9 +8,7 @@
### BEGIN INIT INFO
# Provides: ocfs2
# Required-Start: $network o2cb
-# Required-Stop:
-# X-UnitedLinux-Should-Start:
-# X-UnitedLinux-Should-Stop:
+# Required-Stop: $null
# Default-Start: 2 3 5
# Default-Stop:
# Description: Mount OCFS2 volumes at boot.