From: Peter Rajnoha <prajnoha@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH] Suppress locking error messages in monitoring initscripts
Date: Thu, 11 Aug 2011 12:34:39 +0200 [thread overview]
Message-ID: <4E43B03F.1050606@redhat.com> (raw)
We already use --sysinit to disable these messages when using
"vgchange -ay" in rc.sysinit stage. However, there's also a
"vgchange --monitor y" call later, but this is still too early
to expect all locks to have the infrastructure in place (like
using cluster locking globally in lvm.conf, but monitoring starts
much earlier than cluster infrastructure, so we'd always end with
a scary error message at boot).
The user should not see these messages about socket failures and
fallback to another type of locking, at least not at this moment.
It's misleading - this is actually not a real problem at all, but
the messages look like something terrible is happening.
Peter
---
lib/locking/locking.c | 2 +-
scripts/lvm2_monitoring_init_red_hat.in | 1 +
scripts/lvm2_monitoring_systemd_red_hat.service.in | 1 +
3 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/lib/locking/locking.c b/lib/locking/locking.c
index 8d709f6..a234ed9 100644
--- a/lib/locking/locking.c
+++ b/lib/locking/locking.c
@@ -221,7 +221,7 @@ static void _update_vg_lock_count(const char *resource, uint32_t flags)
*/
int init_locking(int type, struct cmd_context *cmd, int suppress_messages)
{
- if (ignorelockingfailure() && getenv("LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES"))
+ if (getenv("LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES"))
suppress_messages = 1;
if (type < 0)
diff --git a/scripts/lvm2_monitoring_init_red_hat.in b/scripts/lvm2_monitoring_init_red_hat.in
index 4812c75..0988511 100644
--- a/scripts/lvm2_monitoring_init_red_hat.in
+++ b/scripts/lvm2_monitoring_init_red_hat.in
@@ -42,6 +42,7 @@ VGS=${sbindir}/vgs
LOCK_FILE="/var/lock/subsys/$DAEMON"
WARN=1
+export LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES=1
start()
{
diff --git a/scripts/lvm2_monitoring_systemd_red_hat.service.in b/scripts/lvm2_monitoring_systemd_red_hat.service.in
index 4715416..b5dd9bb 100644
--- a/scripts/lvm2_monitoring_systemd_red_hat.service.in
+++ b/scripts/lvm2_monitoring_systemd_red_hat.service.in
@@ -8,6 +8,7 @@ Conflicts=shutdown.target
[Service]
Type=oneshot
+Environment=LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES=1
ExecStart=@sbindir@/lvm vgchange --monitor y
ExecStop=@sbindir@/lvm vgchange --monitor n
RemainAfterExit=yes
reply other threads:[~2011-08-11 10:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E43B03F.1050606@redhat.com \
--to=prajnoha@redhat.com \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.