Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 579680

Summary: logrotate postrotate script args
Product: Red Hat Enterprise Linux 5 Reporter: Roland Friedwagner <roland.friedwagner>
Component: logrotateAssignee: Jan Kaluža <jkaluza>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: low Docs Contact:
Priority: low    
Version: 5.5CC: asersen, azelinka, ovasik, rdassen, roland.friedwagner, tsmetana
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: logrotate-3.7.4-12 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 604686 606675 (view as bug list) Environment:
Last Closed: 2011-05-18 14:58:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 604686, 606675    
Attachments:
Description Flags
proposed patch none

Description Roland Friedwagner 2010-04-06 09:08:49 UTC
Hello,

the logrotate package was updated to version logrotate-3.7.4-9
as of advisory RHBA-2008:0881-3

Now the problem with the missing postrotate and prerotate argument 
is getting worse.

Because now the argument is a list of _all_ logfiles which are rotated.

BUT IT SHOULD BE the first argument - the _one_ logfile that is rotated
at this invocation.

Example for an postrotate script as running fine in nearly all
RHEL and RHL releases before but now it is useless:

/var/log/xxx/*.log
/var/log/xxx/debug
{
    daily
    rotate 7
    missingok
    ifempty
    compress
    delaycompress
    create
    lastaction
        service yyy condrestart &>/dev/null
        service yyy condrestart &>/dev/null
    endscript
    postrotate
      [ -f $1.7.gz ] && gzip -dc $1.7.gz | bzip2 >> $1.archive.bz2 && rm
$1.7.gz
      exit 0
    endscript
}

arg1 holds "/var/log/lpis/*.log" on every invocation :-(

Comment from Assignee on reopen of https://bugzilla.redhat.com/show_bug.cgi?id=445554 was
...
  the referenced bug has been opened by the Support Engineering (i.e., on
behalf of the paying customer), I'm not going to re-open it.  If you have a
valid subscription, please go through the standard support channels.  If not
then you may file a new bug yourself and hope for the best.  I'm really sorry.

Also note that you have been using an undocumented feature which always
comes at risk.

Another bad news -- even though I'm still the logrotate upstream developer, I
don't maintain it in RHEL any more and I even left the Engineering department.

So again: if you don't have a valid subscription your best chance is to file
a new bug.
...

Kind Regards, Roland

Comment 1 Jan Kaluža 2010-06-16 13:50:55 UTC
Created attachment 424455 [details]
proposed patch

I think this patch could fix your problem. If "sharedscripts" is not specified in config file, currently rotated file is passed as arg1 to postrotate/prerotate script. If "sharedscripts" is specified, old behaviour is used (whole pattern is passed to postrotate/prerotate script).

Comment 2 RHEL Program Management 2011-01-11 20:38:17 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 3 RHEL Program Management 2011-01-11 23:01:42 UTC
This request was erroneously denied for the current release of
Red Hat Enterprise Linux.  The error has been fixed and this
request has been re-proposed for the current release.

Comment 8 errata-xmlrpc 2011-05-18 14:58:24 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0816.html

Comment 9 Jan Kaluža 2011-11-23 08:47:54 UTC
*** Bug 738275 has been marked as a duplicate of this bug. ***

Comment 10 Jan Kaluža 2011-11-23 08:48:26 UTC
*** Bug 738276 has been marked as a duplicate of this bug. ***