[linux-lvm] lvcreate and lvremove --quiet option is not quiet
jlar310 at gmail.com
Mon Feb 14 17:43:16 UTC 2011
On Mon, Feb 14, 2011 at 10:31 AM, Ray Morris <support at bettercgi.com> wrote:
>> My general scripting philosophy is that automation scripts that
>> do not have errors should not generate output that will cause cron
>> to send an email.
>> So... I grabbed the source code and started nosing around.
> So we'll look forward to seeing your patches I hope?
This is the first time I've ever even looked at LVM source code. I'm
not sure I can be trusted with patches. Thinking about it some more, I
was wondering if the log_info macro is purely for syslog
functionality. I could be barking up the wrong tree in terms of my
suggested approach. I would rather leave this to someone with
experience if the behavior can be agreed upon.
> It does seem logical that it shouldn't produce informational
> messages on stdout with --quiet.
> As to the first part, that got me thinking about the general rule.
> Is it generally agreed that commands which do not have errors "should
> not generate output" or that commands which do not have ERRORs "should
> not generate output on standard ERROR?
> The OP said that these messages are on stdout, not stderr. I'm
> kind of thinking that's right. No errors, nothing on standard error.
> If using --quiet, then no standard output. If lacking a quiet option,
> then cron jobs should redirect stdout to /dev/null, sending mail if
> there are errors on stderr. Thoughts?
> Ray Morris
> support at bettercgi.com
I agree completely with your assessment. The only issue I wanted to
raise is that a quiet option is advertised, but it does not get the
> On Mon, 14 Feb 2011 09:46:05 -0600
> Jeff <jlar310 at gmail.com> wrote:
>> Background: I am using lvm snapshots in a backup script. My general
>> scripting philosophy is that automation scripts that do not have
>> errors should not generate output that will cause cron to send an
>> I am using Ubuntu 10.04 with lvm2.02.54-1ubuntu4.
>> Even with the --quiet option I get "Logical volume <name> created" on
>> stdout with lvcreate and "Logical volume <name> successfully removed"
>> with lvremove.
>> So... I grabbed the source code and started nosing around. In
>> lv_manip.c, I find that these messages are produced with a call to the
>> function log_print. log_print is a macro (in log.h) for
>> LOG_LINE(_LOG_WARN, args). So it looks like the logging system sees
>> these messages as warnings and is printing them even though verbosity
>> is turned down as far as possible. In addition to --quiet on the
>> command line, I have verbose = 0 in lvm.conf which according to the
>> man page "should produce no output".
>> >From my point of view, lv_manip.c should be calling the log_info
>> for these messages and not log_print, thus giving the user control
>> over the output as advertised by the documentation. Disclaimer: I did
>> not dig into the source code far enough to be assured that log_info
>> will generated the proper results, but it certainly appears on the
>> surface to be the right option.
>> I also downloaded the latest source tarball (126.96.36.199) and the
>> situation appears to be the same.
More information about the linux-lvm