I'd like to do logfile rotation for whenever i start a service, but never "automatically".
I'm running a python-based service that logs to a specific logfile.
the service (currently) does not support notification to re-open it's logfiles (e.g.
Also, the service must not be restarted for logfile rotation (it's producing a continuous audio-stream, which should not be interrupted).
The system I'm running on does not have a hardware clock, so the clock gets reset every time the system boots, which makes log entries originating from different reboots in the same file tedious (i get the same date multiple times).
I also want to keep history across various boots.
So the idea is to use log-rotation on each boot (only).
Something like running
/usr/sbin/logrotate --force /etc/logrotate.d/myservice before starting the service should do the trick.
Now my question is, is it possible to configure log-rotationg in
/etc/logrotate.d/myservice in such a way, that it will be never run automatically?
An easy solution would be to not store my logrotate-config file in
/etc/logrotate.d/, but "somewhere else".
But then, I'd like to have my user be able to find the logrotate-config in a well-known place (so they can modify the config at their will).