[Bug 831057] New: Logrotate not running scripts with correct parameters in "nosharedscripts" mode
https://bugzilla.novell.com/show_bug.cgi?id=831057 https://bugzilla.novell.com/show_bug.cgi?id=831057#c0 Summary: Logrotate not running scripts with correct parameters in "nosharedscripts" mode Classification: openSUSE Product: openSUSE 12.3 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: joschibrauchle@gmx.de QAContact: qa-bugs@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36 There is a but in "logrotate" program of versions below 3.8.4: When specifying a pattern to match the rotated files, the pre-/postscripts are supposed to be called with the exact file name of the actual file that is being rotated, not the specified pattern. This is the behavior described in the man page. But actually, this is not the case and the pre-/postrotate scripts are given the pattern as parameter. Example: ------------------- log_files_with_pattern_* { weekly compress dateext rotate 1 notifempty create 644 root root prerotate prerotate_script.sh $1 endscript } ------------------- According to the manpage, logrotate defaults to noscriptmode. Thus, the prerotate script should be run multiple times like this: ------------------- prerotate_script.sh log_files_with_pattern_<CURRENT-FILE-TO-BE-ROTATED-MATCHING-THE-PATTERN> ------------------- but is actually called multiple times like this: ------------------- prerotate_script.sh log_files_with_pattern_<ALL-FILES-MATCHING-REGARDLESS-OF-BEING-ROTATED-OR-NOT> ------------------- This bug makes it impossible for the scripts to run on exactly the file that is being rotated. The BUG was fixed in version 3.8.4 of logrotate. Please see the changelog of version 3.8.4 here: http://svn.fedorahosted.org/svn/logrotate/tags/r3-8-4/CHANGES It states as included fixes: - Call prerotate/postrotate script only for really rotated files in nosharedscripts mode (as stated in man page). Please backport the corresponding changeset to openSUSE 12.x: https://fedorahosted.org/logrotate/changeset/403 This bug also affects all SLES11SPx releases and was reported to Novell as well. Reproducible: Always Steps to Reproduce: 1. Configure pre-/postscript in logrotate with a pattern 2. Run logrotate Actual Results: Pre-/postscripts are called with parameters of all files matching the pattern. Expected Results: Pre-/postscripts should be called with a single parameter of only the actual file that is being rotated. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=831057
https://bugzilla.novell.com/show_bug.cgi?id=831057#c1
--- Comment #1 from Joschi Brauchle
https://bugzilla.novell.com/show_bug.cgi?id=831057
https://bugzilla.novell.com/show_bug.cgi?id=831057#c
FeiXiang Zhang
https://bugzilla.novell.com/show_bug.cgi?id=831057
https://bugzilla.novell.com/show_bug.cgi?id=831057#c2
Vitezslav Cizek
The BUG was fixed in version 3.8.4 of logrotate. Please see the changelog of version 3.8.4 here: http://svn.fedorahosted.org/svn/logrotate/tags/r3-8-4/CHANGES
It states as included fixes: - Call prerotate/postrotate script only for really rotated files in nosharedscripts mode (as stated in man page).
Please backport the corresponding changeset to openSUSE 12.x: https://fedorahosted.org/logrotate/changeset/403
This commit introduced a regression later fixed in https://fedorahosted.org/logrotate/changeset/433 So I'll include that one as well. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=831057
https://bugzilla.novell.com/show_bug.cgi?id=831057#c3
--- Comment #3 from Bernhard Wiedemann
https://bugzilla.novell.com/show_bug.cgi?id=831057
https://bugzilla.novell.com/show_bug.cgi?id=831057#c
Swamp Workflow Management
https://bugzilla.novell.com/show_bug.cgi?id=831057
https://bugzilla.novell.com/show_bug.cgi?id=831057#c6
Vitezslav Cizek
https://bugzilla.novell.com/show_bug.cgi?id=831057
https://bugzilla.novell.com/show_bug.cgi?id=831057#c7
--- Comment #7 from Swamp Workflow Management
https://bugzilla.novell.com/show_bug.cgi?id=831057
https://bugzilla.novell.com/show_bug.cgi?id=831057#c
Leonardo Chiquitto
https://bugzilla.novell.com/show_bug.cgi?id=831057
https://bugzilla.novell.com/show_bug.cgi?id=831057#c8
Swamp Workflow Management
https://bugzilla.novell.com/show_bug.cgi?id=831057
https://bugzilla.novell.com/show_bug.cgi?id=831057#c10
SMASH SMASH
https://bugzilla.novell.com/show_bug.cgi?id=831057
https://bugzilla.novell.com/show_bug.cgi?id=831057#c11
Swamp Workflow Management
https://bugzilla.novell.com/show_bug.cgi?id=831057
https://bugzilla.novell.com/show_bug.cgi?id=831057#c12
--- Comment #12 from Swamp Workflow Management
https://bugzilla.novell.com/show_bug.cgi?id=831057
https://bugzilla.novell.com/show_bug.cgi?id=831057#c
Swamp Workflow Management
participants (1)
-
bugzilla_noreply@novell.com