summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2017-01-23 14:24:27 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2017-01-23 14:55:47 +0100
commitec93f37b86977380b59080981fb912ff30dd80ab (patch)
tree2964488b0bd694ca99c8216a26ce3883a3938453
parent836eb122cec35c1f00281968d92f9d85e67652d7 (diff)
downloadlvm2-ec93f37b86977380b59080981fb912ff30dd80ab.tar.gz
toolcontext: action for LVM_RUN_BY_DMEVENTD env var
When LVM_RUN_BY_DMEVENTD is set to 1, ensure there will be no interaction with dmeventd.
-rw-r--r--lib/commands/toolcontext.c3
-rw-r--r--man/lvm.8.in5
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index 2843bf800..678ee8a0c 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -192,6 +192,9 @@ static int _get_env_vars(struct cmd_context *cmd)
}
}
+ if (strcmp((getenv("LVM_RUN_BY_DMEVENTD") ? : "0"), "1") == 0)
+ init_run_by_dmeventd(cmd);
+
return 1;
}
diff --git a/man/lvm.8.in b/man/lvm.8.in
index f1ffc7a74..cad724bfa 100644
--- a/man/lvm.8.in
+++ b/man/lvm.8.in
@@ -668,6 +668,11 @@ File descriptor to use for report output from LVM commands.
Name of default command profile to use for LVM commands. This profile
is overriden by direct use of \fB\-\-commandprofile\fP command line option.
.TP
+.B LVM_RUN_BY_DMEVENTD
+This variable is normally set by dmeventd plugin to inform lvm2 command
+it is running from dmeventd plugin so lvm2 takes some extra action
+to avoid comunication and deadlocks with dmeventd.
+.TP
.B LVM_SYSTEM_DIR
Directory containing \fBlvm.conf\fP(5) and other LVM system files.
Defaults to "\fI#DEFAULT_SYS_DIR#\fP".