[sheepdog-users] logrotate

Valerio Pachera sirio81 at gmail.com
Wed Oct 8 17:18:58 CEST 2014


2014-10-08 13:48 GMT+02:00 Marcin Mirosław <marcin at mejor.pl>:
> /var/lib/sheepdog/sheep.log
> {
> # taken from rsyslog conf on debian
> postrotate
>         invoke-rc.d rsyslog rotate > /dev/null
> endscript
> }
>
> And, surely, init script should handle "rotate" (or e.g. "reload") and
> sends HUP to daemon.

The issue is that sheeppdog is writing on sheep.log.
This get renamed by rsyslog to sheep.log.1 and it creates a new sheep.log.
Sheep process continue to write anyway in the old file (now sheep.log.1).
We can't stop and start sheep daemon before (prerotate) or after
(postrotate) to avoid triggering a recovery.
Ops, I notice now on my previous mail I copy pasted the old config
without 'copytruncate' option.

/var/lib/sheepdog/sheep.log {
        weekly
        rotate 4
        create
        truncate
}

Using truncate, the file sheep.log doesn't get renamed (but truncated).
Doing so, sheep process can continue writing on it.

As you suggest, this has to be handled by init script.

If I'm missing something about logrotate that I don't know, please tell me.



More information about the sheepdog-users mailing list