From: Dietmar Maurer Date: Fri, 25 Nov 2011 07:50:40 +0000 (+0100) Subject: disable clvmd startup by default X-Git-Url: https://git.proxmox.com/?p=lvm.git;a=commitdiff_plain;h=a60036399e630a439d2df324e3d4c1c5da1a8948 disable clvmd startup by default --- diff --git a/Makefile b/Makefile index a8202b1..2ec39bb 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ LVMVERSION=2.02.86 DMVERSION=1.02.65 DEBRELEASE=1 # also update debian changelog patch -PVERELEASE=${DEBRELEASE}pve1 +PVERELEASE=${DEBRELEASE}pve2 PVEVER=${LVMVERSION}-${PVERELEASE} DMVER=${DMVERSION}-${PVERELEASE} diff --git a/patchdir/autodetect-locking-type.patch b/patchdir/autodetect-locking-type.patch index 2494085..bb4edef 100644 --- a/patchdir/autodetect-locking-type.patch +++ b/patchdir/autodetect-locking-type.patch @@ -42,32 +42,3 @@ Index: new/doc/example.conf.in # Set to 0 to fail when a lock request cannot be satisfied immediately. wait_for_locks = 1 -Index: new/lib/locking/cluster_locking.c -=================================================================== ---- new.orig/lib/locking/cluster_locking.c 2011-09-21 10:08:21.000000000 +0200 -+++ new/lib/locking/cluster_locking.c 2011-09-21 10:10:55.000000000 +0200 -@@ -66,10 +66,14 @@ - { - int local_socket; - struct sockaddr_un sockaddr; -+ int suppress_messages = 0; -+ -+ if (ignorelockingfailure() && getenv("LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES")) -+ suppress_messages = 1; - - /* Open local socket */ - if ((local_socket = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) { -- log_error("Local socket creation failed: %s", strerror(errno)); -+ log_error_suppress(suppress_messages, "Local socket creation failed: %s", strerror(errno)); - return -1; - } - -@@ -82,7 +86,7 @@ - sizeof(sockaddr))) { - int saved_errno = errno; - -- log_error("connect() failed on local socket: %s", -+ log_error_suppress(suppress_messages, "connect() failed on local socket: %s", - strerror(errno)); - if (close(local_socket)) - stack; diff --git a/patchdir/fix-changelog.patch b/patchdir/fix-changelog.patch index 5d2e4f4..ce2ce87 100644 --- a/patchdir/fix-changelog.patch +++ b/patchdir/fix-changelog.patch @@ -1,14 +1,76 @@ Index: new/debian/changelog =================================================================== ---- new.orig/debian/changelog 2011-09-20 12:49:41.000000000 +0200 -+++ new/debian/changelog 2011-09-20 12:53:25.000000000 +0200 -@@ -1,3 +1,9 @@ +--- new.orig/debian/changelog 2011-11-25 08:39:04.000000000 +0100 ++++ new/debian/changelog 2011-11-25 08:46:06.000000000 +0100 +@@ -1,3 +1,17 @@ ++lvm2 (2.02.86-1pve2) unstable; urgency=low ++ ++ * disable clvmd by default ++ ++ * do not set locking type automatically ++ ++ -- Proxmox Support Team Fri, 25 Nov 2011 08:45:28 +0100 ++ +lvm2 (2.02.86-1pve1) unstable; urgency=low -+ ++ + * backport to squeeze for use with Proxmox VE -+ ++ + -- Proxmox Support Team Tue, 20 Sep 2011 12:53:25 +0200 -+ ++ lvm2 (2.02.86-1) unstable; urgency=low * New upstream version. +@@ -56,7 +70,7 @@ + + * Import upstream version 2.02.72: + - CVE-2010-2526: Fix insecure communication between lvm2 and clvmd. +- (Closes: #591204) ++ (Closes: #591204) + - Only use single node clvm if explicitly requested. + + -- Bastian Blank Thu, 19 Aug 2010 14:44:02 +0200 +@@ -523,7 +537,7 @@ + * Don't make /lib/lvm2 the default library directory as it causes initrd + troubles. + Closes: #287042 +- ++ + -- Patrick Caulfield Fri, 24 Dec 2004 12:27:05 +0000 + + lvm2 (2.00.31-1) unstable; urgency=low +@@ -551,7 +565,7 @@ + * Remove "is not recommended for production use" from package description. + Closes: #278919 + * Add lvm2create_initrd to documentation directory. +- ++ + -- Patrick Caulfield Wed, 3 Nov 2004 09:37:56 +0000 + + lvm2 (2.00.24-2) unstable; urgency=low +@@ -596,7 +610,7 @@ + Closes: #260700 + * Add Czech debconf translation + Closes: #265545 +- ++ + -- Patrick Caulfield Fri, 20 Aug 2004 10:44:11 +0100 + + lvm2 (2.00.19-3) unstable; urgency=low +@@ -736,7 +750,7 @@ + -- Andres Salomon Thu, 07 Aug 2003 01:04:59 -0400 + + lvm2 (1.95.15-2) unstable; urgency=low +- ++ + * Calm-before-the-storm release; the next one will either be 2.00 (once + the kill-yer-VGs bug is fixed) or 1.95 with lvm10 compatibility (once + patrick returns from vacation). +@@ -812,7 +826,7 @@ + * Add dmsetup as a suggestion. + * Add /etc/lvm/lvm.conf conffile. + * Add undocumented(7) for the commands missing manpages. +- ++ + -- Andres Salomon Mon, 4 Mar 2002 04:51:26 -0500 + + lvm2 (0.95.02cvs20020220) unstable; urgency=low diff --git a/patchdir/fix-clvm-init-script.patch b/patchdir/fix-clvm-init-script.patch index 641f998..d8ea94b 100644 --- a/patchdir/fix-clvm-init-script.patch +++ b/patchdir/fix-clvm-init-script.patch @@ -1,7 +1,7 @@ Index: new/debian/clvm.init =================================================================== ---- new.orig/debian/clvm.init 2011-09-21 11:08:28.000000000 +0200 -+++ new/debian/clvm.init 2011-09-21 11:22:15.000000000 +0200 +--- new.orig/debian/clvm.init 2011-11-25 08:39:04.000000000 +0100 ++++ new/debian/clvm.init 2011-11-25 08:42:54.000000000 +0100 @@ -4,8 +4,8 @@ # Provides: clvm # Required-Start: $remote_fs lvm2 cman @@ -13,8 +13,36 @@ Index: new/debian/clvm.init # Short-Description: start and stop the lvm cluster locking daemon ### END INIT INFO # -@@ -44,10 +44,10 @@ +@@ -26,28 +26,31 @@ + . /lib/lsb/init-functions + if [ ! -f /etc/cluster/cluster.conf ]; then +- log_failure_msg "clvmd: cluster not configured. Aborting." ++ log_action_msg "clvmd: cluster not configured" + exit 0 + fi + +-if ! cman_tool status >/dev/null 2>&1; then +- log_failure_msg "clvmd: cluster is not running. Aborting." +- exit 0 +-fi +- +-CLVMDTIMEOUT=20 ++CLVMDTIMEOUT=30 ++START_CLVM=no + + # Read configuration variable file if it is present + [ -r /etc/default/$NAME ] && . /etc/default/$NAME + ++[ "$START_CLVM" = "yes" ] || exit 0 ++ + DAEMON_OPTS="-T$CLVMDTIMEOUT" + ++if ! cman_tool status >/dev/null 2>&1; then ++ log_failure_msg "clvmd: cluster is not running. Aborting." ++ exit 1 ++fi ++ do_start() { - start-stop-daemon --start --quiet --exec $DAEMON -- $DAEMON_OPTS || status="$?" @@ -26,6 +54,16 @@ Index: new/debian/clvm.init } do_activate() +@@ -55,9 +58,6 @@ + if [ -n "$LVM_VGS" ] ; then + log_action_msg "Activating VGs $LVM_VGS" + vgchange -ayl $LVM_VGS || return $? +- else +- log_action_msg "Activating all VGs" +- vgchange -ayl || return $? + fi + } + @@ -91,7 +91,7 @@ case "$status" in 0) log_end_msg 0 ;; @@ -48,8 +86,8 @@ Index: new/debian/clvm.init do_deactivate Index: new/debian/rules =================================================================== ---- new.orig/debian/rules 2011-09-21 11:08:28.000000000 +0200 -+++ new/debian/rules 2011-09-21 11:08:51.000000000 +0200 +--- new.orig/debian/rules 2011-11-25 08:39:04.000000000 +0100 ++++ new/debian/rules 2011-11-25 08:39:39.000000000 +0100 @@ -160,7 +160,7 @@ install_clvm: DIR = $(BUILD_DIR)/install_deb install_clvm: $(STAMPS_DIR)/install_deb @@ -59,3 +97,20 @@ Index: new/debian/rules +$(MAKE_SELF) install-base install_dmsetup: export DH_OPTIONS = -pdmsetup +Index: new/debian/clvm.default +=================================================================== +--- new.orig/debian/clvm.default 2011-11-25 08:39:04.000000000 +0100 ++++ new/debian/clvm.default 2011-11-25 08:42:26.000000000 +0100 +@@ -1,8 +1,11 @@ + # Bourne shell compatible script, sourced by /etc/init.d/clvm to set + # additional arguments for clvmd. + ++# enable clmvd ++#START_CLVM=yes ++ + # Startup timeout: +-CLVMDTIMEOUT=20 ++#CLVMDTIMEOUT=30 + + # Volume groups to activate on startup: + # LVM_VGS="cluster_vg1 cluster_vg2" diff --git a/patchdir/fix-libdevmapper-priority.patch b/patchdir/fix-libdevmapper-priority.patch new file mode 100644 index 0000000..ff50ae0 --- /dev/null +++ b/patchdir/fix-libdevmapper-priority.patch @@ -0,0 +1,13 @@ +Index: new/debian/control +=================================================================== +--- new.orig/debian/control 2011-09-22 10:21:22.000000000 +0200 ++++ new/debian/control 2011-09-22 10:21:53.000000000 +0200 +@@ -47,7 +47,7 @@ + + Package: libdevmapper1.02.1 + Section: libs +-Priority: required ++Priority: optional + Architecture: any + Depends: ${shlibs:Depends}, ${misc:Depends}, dmsetup (>= ${binary:Version}) + Breaks: lvm2 (<< 2.02.66) diff --git a/patchdir/series b/patchdir/series index 564f48e..f88fe54 100644 --- a/patchdir/series +++ b/patchdir/series @@ -3,5 +3,7 @@ fix-clvm-init-script.patch fix-changelog.patch fix-fsadm-install.patch remove-udebs.patch -autodetect-locking-type.patch +#autodetect-locking-type.patch +suppress-error-messages.patch fix-lvm2-init-script-patch +fix-libdevmapper-priority.patch diff --git a/patchdir/suppress-error-messages.patch b/patchdir/suppress-error-messages.patch new file mode 100644 index 0000000..91eaac2 --- /dev/null +++ b/patchdir/suppress-error-messages.patch @@ -0,0 +1,29 @@ +Index: new/lib/locking/cluster_locking.c +=================================================================== +--- new.orig/lib/locking/cluster_locking.c 2011-09-21 10:08:21.000000000 +0200 ++++ new/lib/locking/cluster_locking.c 2011-09-21 10:10:55.000000000 +0200 +@@ -66,10 +66,14 @@ + { + int local_socket; + struct sockaddr_un sockaddr; ++ int suppress_messages = 0; ++ ++ if (ignorelockingfailure() && getenv("LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES")) ++ suppress_messages = 1; + + /* Open local socket */ + if ((local_socket = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) { +- log_error("Local socket creation failed: %s", strerror(errno)); ++ log_error_suppress(suppress_messages, "Local socket creation failed: %s", strerror(errno)); + return -1; + } + +@@ -82,7 +86,7 @@ + sizeof(sockaddr))) { + int saved_errno = errno; + +- log_error("connect() failed on local socket: %s", ++ log_error_suppress(suppress_messages, "connect() failed on local socket: %s", + strerror(errno)); + if (close(local_socket)) + stack;