[mythtv-users] mythbackend.log is buffered?
Jerome Yuzyk
jerome at supernet.ab.ca
Mon Oct 26 17:04:14 UTC 2015
On Monday, October 26, 2015 10:17:13 AM Eric Sharkey wrote:
> On Mon, Oct 26, 2015 at 10:12 AM, Simon Hobson <linux at thehobsons.co.uk> wrote:
> > Karl Newman <newmank1 at asme.org> wrote:
> >
> >> So probably the solution would be to add a `killall -HUP mythbackend` (or mythlogserver?) lastaction command to the logrotate config.
> >
> > That sounds a bit drastic, but somehow you have to get the program to start writing to a different log file.
>
> The HUP signal is the standard way to do that. The deb multimedia
> packages have:
>
> mythtered% cat /etc/logrotate.d/mythlogserver
> /var/log/mythtv/*.log {
> daily
> rotate 7
> notifempty
> delaycompress
> sharedscripts
> compress
> postrotate
> if [ -z "pidof mythlogserver" ]; then
> pkill -HUP mythlogserver
> fi
> endscript
> su mythtv mythtv
> }
>
> Eric
This is what I've been given for Myth from the RPMFusion packages. I think the 'nocreate' option is what is not creating a new log file, unlike every other logfile on any of my Fedora systems. Not sure why it's there, except maybe it's expected that the restarting mythbackend will create it. Is that the logic? Is there a reason I shouldn't remove that option?
[mythtv at tv bin]$ sudo cat /etc/logrotate.d/mythtv
#
# logrotate doesn't support pattern precedence, so they have to be explicit
#
# logs that should be deleted every day
/var/log/mythtv/mythcommflag.*.*.log
/var/log/mythtv/mythpreviewgen.*.*.log
/var/log/mythtv/mythtranscode.*.*.log
{
daily
rotate 0
nocreate
missingok
ifempty
}
# all other non-backend logs are kept for a week
/var/log/mythtv/mythfilldatabase*.*.*.log
/var/log/mythtv/mythmetadatalookup*.*.*.log
{
weekly
rotate 0
nocreate
missingok
ifempty
}
# backend log: keep for 4 weeks & compress
/var/log/mythtv/mythbackend.*.*.log {
weekly
rotate 4
nocreate
missingok
ifempty
compress
compresscmd /usr/bin/bzip2
uncompresscmd /usr/bin/bunzip2
compressext .bz2
firstaction
/bin/systemctl kill mythbackend.service --signal=HUP --kill-who=main 2>/dev/null || true
endscript
# general cleanup after 4 weeks of anything we might have missed
lastaction
find /var/log/mythtv -type f -mtime +28 -delete
endscript
}
--
A little of Jerome's MythTV World: http://mythtv.bss.ab.ca
More information about the mythtv-users
mailing list