Skip to contentSkip to conversation

master - lvm: recognize LVM_COMMAND_PROFILE env var for default command profile to use in LVM commands

PATCH Peter Rajnoha 1 participant 1 message Feb 9, 2015

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b6f558adcc3b08cb627aca0a0cddbe65bdd19052
Commit:        b6f558adcc3b08cb627aca0a0cddbe65bdd19052
Parent:        4e4ea46cfee9afcfc9a48eb60925177890c5ec31
Author:        Peter Rajnoha <[email protected]>
AuthorDate:    Mon Feb 9 14:16:24 2015 +0100
Committer:     Peter Rajnoha <[email protected]>
CommitterDate: Mon Feb 9 14:16:30 2015 +0100

lvm: recognize LVM_COMMAND_PROFILE env var for default command profile to use in LVM commands

Once LVM_COMMAND_PROFILE environment variable is specified, the profile referenced is used just like it was specified using "<lvm command> --commandprofile". If both --commandprofile cmd line option and LVM_COMMAND_PROFILE env var is used, the --commandprofile cmd line option gets preference.

---
 WHATS_NEW          |    1 +
 man/lvm.8.in       |    8 ++++++-
 tools/lvmcmdline.c |   53 ++++++++++++++++++++++++++++++++++++++++++++-------
 3 files changed, 53 insertions(+), 9 deletions(-)
WHATS_NEW +1 -0
index cd4abfe..6488f44 100644
@@ -1,5 +1,6 @@
 Version 2.02.117 - 
 ====================================
+  Add LVM_COMMAND_PROFILE env var to set default command profile name to use.
   set CLOEXEC flag on file descriptors originating in libdaemon
 
 Version 2.02.116 - 30th January 2015
man/lvm.8.in +7 -1
index 5347e94..f87729e 100644
@@ -291,7 +291,9 @@ placing two stripes on the same Physical Volume.
 .IR \fB\-\-commandprofile " " \fIProfileName
 Selects the command configuration profile to use when processing an LVM command.
 See also \fBlvm.conf\fP(5) for more information about \fBcommand profile config\fP and
-the way it fits with other LVM configuration methods.
+the way it fits with other LVM configuration methods. Using \fB\-\-commandprofile\fP
+option overrides any command profile specified via \fBLVM_COMMAND_PROFILE\fP
+environment variable.
 .TP
 .IR \fB\-\-metadataprofile " " \fIProfileName
 Selects the metadata configuration profile to use when processing an LVM command.
@@ -480,6 +482,10 @@ All tools return a status code of zero on success or non-zero on failure.
 Directory containing \fI.lvm_history\fP if the internal readline
 shell is invoked.
 .TP
+.B LVM_COMMAND_PROFILE
+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_SYSTEM_DIR
 Directory containing \fBlvm.conf\fP(5) and other LVM system files.
 Defaults to "#DEFAULT_SYS_DIR#".
tools/lvmcmdline.c +45 -8

88 lines not on this page · raw message