[mythtv-users] Logrotate settings for mythbackend.log?

Joseph A. Caputo jcaputo1 at comcast.net
Tue Jan 17 18:34:42 UTC 2006


On Friday 13 January 2006 17:40, Robert Tsai wrote:
> On Fri, Jan 13, 2006 at 03:19:18PM -0500, Joseph A. Caputo wrote:
> > OK, well I thought this was working, but I guess it's not.  Anybody 
have 
> > a good logrotate configuration for mythbackend.log?  Here's mine, 
but 
> > it doesn't seem to be working.  (I'm running FC3)
> 
> 	% cat /home/myth/logrotate.d/mythbackend
> 	compress
> 	compresscmd /usr/bin/bzip2
> 	compressext .bz2
> 	nodelaycompress
> 	rotate 7
> 	nomail
> 	missingok
> 	create 644
> 
> 	/var/log/myth/mythbackend.log {
> 		size 32M
> 		postrotate
> 			kill -HUP `cat /var/run/mythbackend.pid` 2>/dev/null
> 		endscript
> 	}

Note that, although SVN mythbackend will close & reopen the logfile when 
it receives a SIGHUP, the above settings will only work if your 
mythbackend startup script puts the PID in /var/run/mythbackend.pid (or 
another file...)

A more generic way of doing this might be:

	killall -s HUP mythbackend

Of course, that assumes that you haven't renamed the mythbackend 
executable, and also that you're only running one mythbackend process, 
both of which are relatively safe assumuption on a Myth box, unless 
you're doing serious mythbackend development.

-JAC


More information about the mythtv-users mailing list