[Ovirt-devel] [PATCH] * ovirt-logrotate (EXITVALUE): Propagate failure to exit, too.
Perry N. Myers
pmyers at redhat.com
Mon Sep 8 13:06:56 UTC 2008
Jim Meyering wrote:
> "Perry N. Myers" <pmyers at redhat.com> wrote:
>> Jim Meyering wrote:
>>> Here's an even tinier change:
>>> Without this, a failing ovirt-logrotate would exit successfully.
>>> >From 2691a4203489e250fa1e8d64e3c52072f25929a3 Mon Sep 17 00:00:00 2001
>>> From: Jim Meyering <meyering at redhat.com>
>>> Date: Mon, 8 Sep 2008 11:43:06 +0200
>>> Subject: [PATCH] * ovirt-logrotate (EXITVALUE): Propagate failure to exit, too.
>>> logrotate/ovirt-logrotate | 3 +--
>>> 1 files changed, 1 insertions(+), 2 deletions(-)
>>> diff --git a/logrotate/ovirt-logrotate b/logrotate/ovirt-logrotate
>>> index f0a2dde..a6a394d 100644
>>> --- a/logrotate/ovirt-logrotate
>>> +++ b/logrotate/ovirt-logrotate
>>> @@ -6,5 +6,4 @@ EXITVALUE=$?
>>> if [ $EXITVALUE != 0 ]; then
>>> /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
>>> -exit 0
>>> +exit $EXITVALUE
>> What happens if a logrotate script returns a non-zero value? Is there
>> something that we need to catch and handle here?
> I noticed the problem via inspection and fixed it on principle ;-)
> In case someone runs ovirt-logrotate ... || notify-me-of-failure
> However, now I see that it is invoked solely via cron. In that case,
> the failure will be recorded via logger, but the exit status will be ignored.
That's what I thought... Still, there's not reason to artificially return
zero in all cases. So I'd say go ahead and push this patch. ACK
|=- Red Hat, Engineering, Emerging Technologies, Boston -=|
|=- Email: pmyers at redhat.com -=|
|=- Office: +1 412 474 3552 Mobile: +1 703 362 9622 -=|
|=- GnuPG: E65E4F3D 88F9 F1C9 C2F3 1303 01FE 817C C5D2 8B91 E65E 4F3D -=|
More information about the ovirt-devel