summaryrefslogtreecommitdiff
blob: c70350c110ab339bd0d709ff5da0dc65517ad94d (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
diff -Naur ctdb-1.0.114.orig/config/functions ctdb-1.0.114/config/functions
--- ctdb-1.0.114.orig/config/functions	2010-04-04 18:01:18.278707515 +0200
+++ ctdb-1.0.114/config/functions	2010-04-04 18:08:05.792447032 +0200
@@ -22,6 +22,8 @@
 	. /etc/default/$1
     elif [ -f $CTDB_BASE/sysconfig/$1 ]; then
 	. $CTDB_BASE/sysconfig/$1
+	elif [ -f /etc/config.d/$1 ]; then
+	. /etc/config.d/$name
     fi
 }
 
@@ -33,6 +35,8 @@
 
     if [ -x /sbin/startproc ]; then
         CTDB_INIT_STYLE="suse"
+	elif [ -x /bin/rc-status ] ; then
+		CTDB_INIT_STYLE="gentoo"
     elif [ -x /sbin/start-stop-daemon ]; then
         CTDB_INIT_STYLE="debian"
     else
@@ -356,6 +360,9 @@
 	[ -x /etc/init.d/nfslock ] && {
 		PLATFORM="rhel"
 	}
+	[ -x etc/init.d/nfs ] && {
+		PLATFORM="gentoo"
+	}
 
 	case $PLATFORM in
 	sles)
@@ -380,6 +387,16 @@
 			;;
 		esac
 		;;
+	gentoo)
+		case $1 in
+		start)
+			service nfs start
+			;;
+		stop)
+			service nfs stop > /dev/null 2>&1
+			;;
+		esac
+		;;
 	*)
 		echo "Unknown platform. NFS is not supported with ctdb"
 		exit 1
@@ -398,6 +415,9 @@
 	[ -x /etc/init.d/nfslock ] && {
 		PLATFORM="rhel"
 	}
+	[ -x etc/init.d/nfs ] && {
+		PLATFORM="gentoo"
+	}
 
 	case $PLATFORM in
 	sles)
@@ -422,6 +442,18 @@
 			;;
 		esac
 		;;
+	gentoo)
+		# for gentoo there is no service for lockmanager
+		# so we instead just shutdown/restart nfs
+		case $1 in
+		start)
+			service nfs start
+			;;
+		stop)
+			service nfs stop > /dev/null 2>&1
+			;;
+		esac
+		;;
 	*)
 		echo "Unknown platform. NFS locking is not supported with ctdb"
 		exit 1