]> git.proxmox.com Git - lvm.git/blob - patchdir/fix-clvm-init.patch
fix clvmd init script
[lvm.git] / patchdir / fix-clvm-init.patch
1 Index: new/debian/clvm.defaults
2 ===================================================================
3 --- new.orig/debian/clvm.defaults 2013-03-03 12:46:47.000000000 +0100
4 +++ new/debian/clvm.defaults 2013-03-29 08:01:33.000000000 +0100
5 @@ -1,9 +1,11 @@
6 # Bourne shell compatible script, sourced by /etc/init.d/clvm to set
7 # additional arguments for clvmd.
8
9 +# enable clmvd
10 +#START_CLVM=yes
11 +
12 # Startup timeout:
13 -CLVMDTIMEOUT=20
14 +#CLVMDTIMEOUT=30
15
16 # Volume groups to activate on startup:
17 # LVM_VGS="cluster_vg1 cluster_vg2"
18 -
19 Index: new/debian/clvm.init
20 ===================================================================
21 --- new.orig/debian/clvm.init 2013-03-03 12:46:47.000000000 +0100
22 +++ new/debian/clvm.init 2013-03-29 08:35:07.000000000 +0100
23 @@ -2,12 +2,12 @@
24 #
25 ### BEGIN INIT INFO
26 # Provides: clvm
27 -# Required-Start: lvm2
28 -# Required-Stop: lvm2
29 +# Required-Start: lvm2 cman
30 +# Required-Stop: lvm2 cman
31 # Should-Start: cman corosync openais
32 # Should-Stop: cman corosync openais
33 -# Default-Start: S
34 -# Default-Stop: 0 6
35 +# Default-Start: 2 3 4 5
36 +# Default-Stop: 0 1 6
37 # Short-Description: start and stop the lvm cluster locking daemon
38 ### END INIT INFO
39 #
40 @@ -28,28 +28,31 @@
41 . /lib/lsb/init-functions
42
43 if [ ! -f /etc/cluster/cluster.conf ]; then
44 - log_failure_msg "clvmd: cluster not configured. Aborting."
45 + log_action_msg "clvmd: cluster not configured"
46 exit 0
47 fi
48
49 -if ! cman_tool status >/dev/null 2>&1; then
50 - log_failure_msg "clvmd: cluster is not running. Aborting."
51 - exit 0
52 -fi
53 -
54 -CLVMDTIMEOUT=20
55 +CLVMDTIMEOUT=30
56 +START_CLVM=no
57
58 # Read configuration variable file if it is present
59 [ -r /etc/default/$NAME ] && . /etc/default/$NAME
60
61 +[ "$START_CLVM" = "yes" ] || exit 0
62 +
63 DAEMON_OPTS="-T$CLVMDTIMEOUT"
64
65 +if ! cman_tool status >/dev/null 2>&1; then
66 + log_failure_msg "clvmd: cluster is not running. Aborting."
67 + exit 1
68 +fi
69 +
70 do_start()
71 {
72 - start-stop-daemon --start --quiet --exec $DAEMON -- $DAEMON_OPTS || status="$?"
73 + start-stop-daemon --start --quiet --exec $DAEMON -- $DAEMON_OPTS || return $?
74 # flush cache
75 vgscan > /dev/null 2>&1
76 - return $status
77 + return 0
78 }
79
80 do_activate()
81 @@ -57,9 +60,6 @@
82 if [ -n "$LVM_VGS" ] ; then
83 log_action_msg "Activating VGs $LVM_VGS"
84 vgchange -ayl $LVM_VGS || return $?
85 - else
86 - log_action_msg "Activating all VGs"
87 - vgchange -ayl || return $?
88 fi
89 }
90
91 Index: new/debian/rules
92 ===================================================================
93 --- new.orig/debian/rules 2013-03-29 08:01:30.000000000 +0100
94 +++ new/debian/rules 2013-03-29 08:01:33.000000000 +0100
95 @@ -77,7 +77,7 @@
96 $(CONFIGURE) \
97 --libdir=\$${exec_prefix}/lib/$(DEB_HOST_MULTIARCH) \
98 --with-optimisation="$(CFLAGS_OPT_DEB)" \
99 - --with-clvmd=cman,corosync,openais \
100 + --with-clvmd=cman,corosync \
101 --with-cluster=internal \
102 --with-device-uid=0 \
103 --with-device-gid=6 \
104 @@ -165,7 +165,7 @@
105 install_clvm: DIR = $(BUILD_DIR)/install_deb
106 install_clvm: $(STAMPS_DIR)/install_deb
107 +$(MAKE_SELF) install-base-prep INSTALL_DIR='$(DIR)'
108 - dh_installinit --no-start -- start 63 S . start 51 0 6 .
109 + dh_installinit --no-start -- start 63 2 3 4 5 . start 51 0 1 6 .
110 +$(MAKE_SELF) install-base
111
112 install_dmeventd: export DH_OPTIONS = -pdmeventd