kunai icon indicating copy to clipboard operation
kunai copied to clipboard

[featurerequest] kunai log rotate custom permissions

Open juju4 opened this issue 10 months ago • 1 comments

I want to retrieve /var/log/kunai/events.log through a log collector tool (otel) which runs as non-root. It needs read access for systemd-journal group, openobserve-agent user or other. Because kunai handles directly log files rotation, logrotate post-rotate is not an option to add an extra acl like setfacl -m g:systemd-journal:r -- $1. Could you add an option for it? Thanks

juju4 avatar Feb 16 '25 20:02 juju4

two simpler options than acl would be

  • option to customize log user/group
  • option to disable log rotation to use other tools like logrotate

I checked workaround with inotifywait, watchexec and in the end implemented systemd.path (with limitations as only file change trigger, so avoid permanent call with a TriggerLimit) https://github.com/juju4/ansible-kunai/blob/devel/templates/kunailog.path.j2

juju4 avatar Mar 02 '25 21:03 juju4