Opened 4 years ago

Last modified 4 years ago

#72 new enhancement

handle logrotation in logviewer

Reported by: victor Owned by: fredl
Priority: major Milestone: 0.9
Component: vuurmuur-conf Version:
Keywords: Cc: fredl@…

Description

In the Vuurmuur_conf logviewer the logfiles are 'tailed' and displayed. If the logfile is rotated however, the viewer just stops displaying new lines. This is because the file needs to be reopened.

Add a mechanism to reopen the files from time to time. Probably just after a period of silence. So if there hasn't been a new line for say a minute, close and open the file.

Change History (6)

comment:1 Changed 4 years ago by victor

  • Component changed from suite to vuurmuur-conf
  • Status changed from new to assigned

comment:2 in reply to: ↑ description Changed 4 years ago by fredl

Replying to victor:

In the Vuurmuur_conf logviewer the logfiles are 'tailed' and displayed. If the logfile is rotated however, the viewer just stops displaying new lines. This is because the file needs to be reopened.

Add a mechanism to reopen the files from time to time. Probably just after a period of silence. So if there hasn't been a new line for say a minute, close and open the file.

Maybe it's nicer to have vuurmuur_conf react to signals instead and reopen the file when it gets a -HUP or something. It's very easy to add a post script to the logrotate scripts.

comment:3 Changed 4 years ago by fredl

Or perhaps an even better way to do this would be by using inotify kernel events
(see http://en.wikipedia.org/wiki/Inotify). I'll take a stab at putting it in there.

comment:4 Changed 4 years ago by fredl

  • Cc fredl@… added

Victor, could you assign this one to me? Like we talked about on IRC, I've decided trying to take a stab at this. I'm even trying to document my progress at http://wiki.3dn.nl/index.php/Vuurmuur

comment:5 Changed 4 years ago by fredl

  • Owner changed from victor to fredl
  • Status changed from assigned to new

comment:6 Changed 4 years ago by fredl

This one's pretty silly if you think about it. vuurmuur_conf tails files created by vuurmuur_log. Those files should not be logrotated unexpectedly; if they do get rotated it should be done by our own scripts (scripts/vuurmuur-logrotate). Instead of a postrotate /bin/kill -HUP pidof vuurmuur_log, I'd like to do a postrotate $VUURMUUR_LOCATION/vuurmuur_log -R(estart) and on a restart make vuurmuur_log check if vuurmuur_conf is connected. If it's connected we can tell it through IPC to reload.

Note: See TracTickets for help on using tickets.