#15 postrotate_cmd ineffective if specified before logdir

closed-fixed
nobody
None
5
2012-08-18
2009-10-27
No

Because of an omission when copying cur_block fields to new_output while processing a "logdir" config line, the "postrotate_cmd" option has no effect if it occurs before "logdir" in a block.

This is particularly a problem because it means specifying a "postrotate_cmd" in the default options section, where there is not normally a "logdir" option at all, has no effect.

This simple addition fixes the problem:

Index: src/metalog.c

--- src/metalog.c (revision 163)
+++ src/metalog.c (working copy)
@@ -222,6 +222,7 @@
new_output->maxsize = (*cur_block)->maxsize;
new_output->maxfiles = (*cur_block)->maxfiles;
new_output->maxtime = (*cur_block)->maxtime;
+ new_output->postrotate_cmd = (*cur_block)->postrotate_cmd;
new_output->showrepeats = (*cur_block)->showrepeats;
new_output->stamp_fmt = (*cur_block)->stamp_fmt;
new_output->flush = (*cur_block)->flush;

Discussion

  • Matt Whitlock

    Matt Whitlock - 2012-02-06

    Please apply patch 3314475 to fix this bug.

     
  • Mike Frysinger

    Mike Frysinger - 2012-08-18
    • status: open --> closed-fixed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks