Bug 129551 - logrotate does not pass log file name to pre/postrotate scripts
Summary: logrotate does not pass log file name to pre/postrotate scripts
Keywords:
Status: CLOSED DUPLICATE of bug 126490
Alias: None
Product: Fedora
Classification: Fedora
Component: logrotate
Version: 2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Cristian Gafton
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-08-10 11:02 UTC by Andreas Karrer
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2006-02-21 19:05:03 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Andreas Karrer 2004-08-10 11:02:55 UTC
Description of problem:
logrotate-3.6 passed the name of the script to rotate as argument 1
to the pre/postrotate scripts. 3.7 does not do that anymore

between logrotate 3.6 and 3.7, system() calls were replaced
by a runScript() routine which uses execlp(). It calls execlp wrongly.


Version-Release number of selected component (if applicable):
logrotate-3.7-4


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Andreas Karrer 2004-08-10 11:07:58 UTC
The second argument of execlp is argv0, the name of the process.
The log file name to be passted to the pre/postrotate script should
be passed as the *3rd* argument.

--- logrotate.c.orig    2004-01-26 21:08:04.000000000 +0100
+++ logrotate.c 2004-08-10 13:07:24.000000000 +0200
@@ -110,7 +110,7 @@
     close(fd);
 
     if (!fork()) {
-       execlp(filespec, logfn, NULL);
+       execlp(filespec, filespec, logfn, NULL);
        exit(1);
     }
 


Comment 2 Miloslav Trmač 2004-10-19 16:50:24 UTC

*** This bug has been marked as a duplicate of 126490 ***

Comment 3 Red Hat Bugzilla 2006-02-21 19:05:03 UTC
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.


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