Skip to content

Log rotation (SIGHUP) support #704

Closed

Description

@selivan

To rotate ossec logs I have to use logrotate "copytruncate" option. That is unconvenient hack that can lead to loosing some amount of data. It would be nice to make ossec-monitord handle SIGHUP (or SIGUSR1) signal and re-open log files.

Activity

  1. santiago-bassett commented on Dec 3, 2015

    @santiago-bassett
    Contributor

    Interesting topic. For archives.log and alerts.log OSSEC uses symbolic links, an ossec-monitord takes care of rotating those, so we don't need to restart ossec processes or use "copytruncate". How about using ossec-monitord to rotate ossec.log and active-response.log as well? Wouldn't that make more sense than using logrotate? (specially considering that OSSEC is designed to run in a chroot environment, not to interact much with the host)

  2. aquerubin commented on Dec 3, 2015

    @aquerubin
    Contributor
  3. selivan commented on Dec 4, 2015

    @selivan
    Author

    Yes, single mechanism for rotating all logs would be nice. Current documentation recommends logrotate for ossec.log: http://ossec.github.io/docs/faq/ossec.html#how-can-i-get-ossec-log-to-rotate-daily

    Btw, how can I change settings for log rotation by ossec-monitord? I've found only options that change compressing/signing: http://ossec.github.io/docs/syntax/head_internal_options.analysisd.html#internal-options-conf-monitord

  4. santiago-bassett commented on Dec 8, 2015

    @santiago-bassett
    Contributor

    If those are not in internal_options.conf I would assume those options are hardcoded.

    If everyone agrees rotation for ossec.log and active-response.log should be implemented to be done by ossec-monitord, I'll add it to my todo and try to do this once I have some spare time.

  5. added 2 commits that reference this issue on Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions