[Ovirt-devel] [PATCH] * ovirt-logrotate (EXITVALUE): Propagate failure to exit, too.

Jim Meyering jim at meyering.net
Mon Sep 8 12:58:56 UTC 2008


"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]"
>>  fi
>> -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.




More information about the ovirt-devel mailing list