RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 604686 - logrotate postrotate script args
Summary: logrotate postrotate script args
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: logrotate
Version: 6.0
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Jan Kaluža
QA Contact: Alex Sersen
URL:
Whiteboard:
Depends On: 579680 606675
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-06-16 13:53 UTC by Jan Kaluža
Modified: 2013-11-01 01:33 UTC (History)
6 users (show)

Fixed In Version: logrotate-3.7.8-10.el6
Doc Type: Bug Fix
Doc Text:
Clone Of: 579680
Environment:
Last Closed: 2010-11-10 21:06:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
proposed patch (932 bytes, patch)
2010-06-16 13:55 UTC, Jan Kaluža
no flags Details | Diff

Description Jan Kaluža 2010-06-16 13:53:05 UTC
+++ This bug was initially created as a clone of Bug #579680 +++

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

--- Additional comment from jkaluza on 2010-06-16 09:50:55 EDT ---

Created an attachment (id=424455)
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 1 Jan Kaluža 2010-06-16 13:55:42 UTC
Created attachment 424459 [details]
proposed patch

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 3 RHEL Program Management 2010-06-16 14:12:59 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 4 Jan Kaluža 2010-06-17 10:07:35 UTC
Committed in CVS, fixed in version logrotate-3.7.8-10.el6.

http://post-office.corp.redhat.com/archives/cvs-commits-list/2010-June/msg02206.html

Comment 7 releng-rhel@redhat.com 2010-11-10 21:06:25 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.