linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Ray Morris <support@bettercgi.com>
To: LVM general discussion and development <linux-lvm@redhat.com>
Cc: jlar310@gmail.com
Subject: Re: [linux-lvm] lvcreate and lvremove --quiet option is not quiet
Date: Mon, 14 Feb 2011 10:31:12 -0600	[thread overview]
Message-ID: <20110214103112.4fb76864@bettercgi.com> (raw)
In-Reply-To: <AANLkTi=sSJiVJkqOojR7HUs=STDR1-wXNEqaHsv7smWP@mail.gmail.com>

>  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?
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@bettercgi.com

Strongbox - The next generation in site security:
http://www.bettercgi.com/strongbox/

Throttlebox - Intelligent Bandwidth Control
http://www.bettercgi.com/throttlebox/

Strongbox / Throttlebox affiliate program:
http://www.bettercgi.com/affiliates/user/register.php




On Mon, 14 Feb 2011 09:46:05 -0600
Jeff <jlar310@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
> email.
> 
> 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
> >macro
> 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 (2.0.2.84) and the
> situation appears to be the same.
> 
> Jeff
> 
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
> 

  reply	other threads:[~2011-02-14 16:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-14 15:46 [linux-lvm] lvcreate and lvremove --quiet option is not quiet Jeff
2011-02-14 16:31 ` Ray Morris [this message]
2011-02-14 17:43   ` Jeff
2011-02-14 18:14     ` Alasdair G Kergon
2011-02-15 13:02       ` Jeff
2011-02-15 13:41         ` Mike Snitzer
2011-02-15 16:07           ` Jeff
2011-02-15 17:04             ` Mike Snitzer

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=20110214103112.4fb76864@bettercgi.com \
    --to=support@bettercgi.com \
    --cc=jlar310@gmail.com \
    --cc=linux-lvm@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).