summaryrefslogtreecommitdiff
blob: 78936c912f9cad0146cd4dec1e1d5513f4c5f6aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
diff -uNr src/utils/clunfslock.sh.orig src/utils/clunfslock.sh
--- src/utils/clunfslock.sh.orig	1970-01-01 01:00:00.000000000 +0100
+++ src/utils/clunfslock.sh	2006-07-14 15:37:27.000000000 +0200
@@ -0,0 +1,74 @@
+#!/bin/bash
+#
+# (C) 2006 Red Hat, Inc. 
+#
+# Licensed under the GNU General Public License, Version 2.
+#
+# rpc.statd -H $0 to enable.  This provides the HA-callout capability
+# for RHCS-managed NFS services.  Note that you must edit
+# /etc/sysconfig/nfs in order to make this work; clumanager/rgmanager
+# will not interfere with a running nfs statd.
+#
+# Arg 3 (server as known to client) does not work; it's always 127.0.0.1
+# so we traverse all cluster mount points.
+#
+
+clustered_mounts()
+{
+	declare dev mp
+
+	while read dev mp; do
+		if [ "${dev:0:4}" != "/dev" ]; then
+			continue
+		fi
+
+		# XXX Need clumanager to create this on mount
+		if [ -d "$mp/.clumanager" ]; then
+			echo $dev $mp
+		fi
+	done < <(cat /proc/mounts | awk '{print $1,$2}')
+}
+
+
+add-client()
+{
+	declare dev mp
+
+	while read dev mp; do
+		[ -d "$mp/.clumanager/statd/sm" ] || \
+			mkdir -p $mp/.clumanager/statd/sm
+		touch $mp/.clumanager/statd/sm/$1
+	done < <(clustered_mounts)
+}
+
+
+del-client()
+{
+	while read $dev $mp; do
+		[ -d "$mp/.clumanager/statd/sm" ] || \
+			mkdir -p $mp/.clumanager/statd/sm
+		rm -f $mp/.clumanager/statd/sm/$1
+	done < <(clustered_mounts)
+}
+
+case "$1" in
+	add-client)
+		:
+		;;
+	del-client)
+		:
+		;;
+	*)
+		echo "Usage: $0 <add-client|del-client> <host> [server]"
+		exit 0
+esac
+
+
+if [ -z "$2" ]; then
+	echo "Usage: $0 <add-client|del-client> <host> [server]"
+	exit 1
+fi
+
+$1 $2 $3
+exit 0
+