Results 1 to 3 of 3

Thread: Logrotate firing without reason

  1. #1
    xen82a NNTP User

    Unhappy Logrotate firing without reason

    Never mind,

    I had an Apache logfile being rotated

    but the "weekly" criterium of the base logrotate.conf configuration
    was still in effect.

    And when I disabled the size criterium in apache2.conf

    # size=+4096k

    The "weekly" criterium came back into effect.

    But, when it rotated it failed to restart Apache2:

    Jun 08 00:00:02 host logrotate[11223]: apache2.service is not active, cannot reload.

    The httpd_prefork instances all kept running and the apache instance kept writing to the old logfile, that was now unlinked.

  2. #2

    Default Re: Logrotate firing without reason

    This sounds like it is working correctly; is there a reason you think it
    is not?

    From the logtorate.conf manpage:
    minsize  size
    Log files are rotated when they grow bigger than size bytes, but not
    before the additionally specified time interval (daily, weekly, monthly,
    or yearly).  The related size option is similar except that it is mutually
    exclusive with the time  interval
    options, and it causes log files to be rotated without
    regard for the last rotation time.  When minsize is used, both the size
    and timestamp of a log file are considered.
    size size
    Log  files  are  rotated only if they grow bigger then size bytes.
    If size is followed by k, the size is assumed to be in kilobytes.  If the
    M is used, the size is in megabytes, and if G is used, the size is in
    gigabytes. So size 100, size 100k, size 100M and size 100G are all valid.
    Please pardon the typo in the 'size' description there; it's not mine.

    You commented out, i.e. took away, the size parameter, so now the system
    is no longer constrained to rotate only when the file is greater than
    4096k, and instead will rotate when the other requirements are met
    (notifempty is the only one that stands out to me).

    Good luck.

    If you find this post helpful and are logged into the web interface,
    show your appreciation and click on the star below.

    If you want to send me a private message, please let me know in the
    forum as I do not use the web interface often.

  3. #3
    xen82a NNTP User

    Default Re: Logrotate firing without reason

    I initially did not understand that the weekly parameter from the main config would take effect without the size, because the size overrules all "time" parameters.

    Apparently so in any case.

    I then edited my post to change it from being a question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts