1 # To the extent possible under law, Eric Wong has waived all copyright and
2 # related or neighboring rights to this examples
4 # example logrotate config file, I usually keep this in
5 # /etc/logrotate.d/yahns_app on my Debian systems
7 # See the logrotate(8) manpage for more information:
8 # https://linux.die.net/man/8/logrotate
10 # Modify the following glob to match the logfiles your app writes to:
11 /var/log/yahns_app/*.log {
12 # this first block is mostly just personal preference, though
13 # I wish logrotate offered an "hourly" option...
17 compress # must use with delaycompress below
20 # this is important if using "compress" since we need to call
21 # the "lastaction" script below before compressing:
24 # note the lack of the evil "copytruncate" option in this
25 # config. yahns supports the USR1 signal and we send it
26 # as our "lastaction" action:
28 # systemd users do not have PID files,
29 # only signal the @1 process since the @2 is short-lived
30 # and only runs while @1 is restarting.
33 # assuming your pid file is in /var/run/yahns_app/pid
34 pid=/var/run/yahns_app/pid
35 test -s $pid && kill -USR1 "$(cat $pid)"