njh / rotter

Rotter is a Recording of Transmission / Audio Logger for JACK.
http://www.aelius.com/njh/rotter/
GNU General Public License v2.0
50 stars 11 forks source link

implement signal to reopen log file #14

Closed ian-llewellyn closed 13 years ago

ian-llewellyn commented 13 years ago

At the moment rotter keeps a file handle open for the duration of it's run time. I'd like to be able to rotate logs on a weekly basis without stopping the rotter process. Can -SIGUSR1 be used for this purpose?

njh commented 13 years ago

rotter logs to STDOUT, not to a specific file. Are you using this with a specific operating system or init.d script that logs to disk?

I personally use daemontools which deals with the log rotation of messages piped from STDOUT.

Very happy to accept a a patch that assists with this, and it is fine to use SIGUSR1 for this purpose.

ian-llewellyn commented 13 years ago

Right you are. I implemented an init script that reads config files from /etc/rotter_*.conf. I was using an output redirect on rotter rather than a pipe. That's what was causing my logrotate problem.

Amended - thanks for resetting my brain!

Will check out daemontools for this and future projects. Thanks again.