Bug 579680 - logrotate postrotate script args
Summary: logrotate postrotate script args
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: logrotate
Version: 5.5
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Jan Kaluža
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
: 738275 738276 (view as bug list)
Depends On:
Blocks: 604686 606675
TreeView+ depends on / blocked
 
Reported: 2010-04-06 09:08 UTC by Roland Friedwagner
Modified: 2018-11-14 15:38 UTC (History)
6 users (show)

Fixed In Version: logrotate-3.7.4-12
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 604686 606675 (view as bug list)
Environment:
Last Closed: 2011-05-18 14:58:24 UTC
Target Upstream Version:
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0816 0 normal SHIPPED_LIVE logrotate bug fix update 2011-05-18 14:57:14 UTC

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. ***


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