[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#285871: xdm logrotate script eats logs



tag 285871 - moreinfo unreproducible
thanks

On Fri, Mar 25, 2005 at 11:26:17PM +0000, Andrew Suffield wrote:
> While xdm is running, edit /var/lib/logrotate/status and set the date
> on /var/log/xdm.log to a couple of days ago, then run:
> 
> logrotate /etc/logrotate.conf
> 
> as root. This causes a new rotation, rather than having to wait for
> it.
> 
> After this, you should see:
> 
> asuffield@cyclone:~$ ls -l /var/log/xdm.log*
> -rw-r-----  1 root adm    0 Mar 25 23:16 /var/log/xdm.log
> -rw-r-----  1 root adm 1573 Mar 25 23:16 /var/log/xdm.log.1.gz
> 
> asuffield@cyclone:~$ sudo lsof | grep var/log/xdm
> xdm        1965      root    2w      REG        3,6       8376     179574 /var/log/xdm.log.1 (deleted)
> XFree86    2023      root    2w      REG        3,6       8376     179574 /var/log/xdm.log.1 (deleted)
> xdm        2024      root    2w      REG        3,6       8376     179574 /var/log/xdm.log.1 (deleted)
> 
> xdm will now proceed to log into this deleted file. Eventually
> xdm.log.1.gz will be rotated out of existance, and xdm will continue
> logging into the deleted file, leaving you with no xdm logs at all.

Ahhh, ha.

> > > That's the worst logrotate file I've seen in quite a while.
> > 
> > What looks wrong with it?
> > 
> > http://necrotic.deadbeast.net/svn/xfree86/trunk/debian/xdm.logrotate
> > 
> > /var/log/xdm.log {
> > 	notifempty
> > 	missingok
> > }
> 
> No 'delaycompress'. No 'postrotate' to tell xdm to reopen the
> file. And it relies on /etc/logrotate.conf for most of its values,
> which is kinda sloppy. A more normal logrotate entry looks like this:
> 
> /var/log/apache/*.log {
> 	weekly
> 	missingok
> 	rotate 52
> 	compress
> 	delaycompress
> 	notifempty
> 	create 640 root adm
> 	sharedscripts
> 	postrotate
> 	   if [ -f /var/run/apache.pid ]; then \
> 	     if [ -x /usr/sbin/invoke-rc.d ]; then \
> 		invoke-rc.d apache reload > /dev/null; \
> 	     else \
> 	        /etc/init.d/apache reload > /dev/null; \
> 	     fi; \
> 	   fi;
> 	endscript
> }

Okay.  I'll write a new logrotate script for xdm based on the above.

Thanks for following up!

-- 
G. Branden Robinson                |    Any man who does not realize that
Debian GNU/Linux                   |    he is half an animal is only half a
branden@debian.org                 |    man.
http://people.debian.org/~branden/ |    -- Thornton Wilder

Attachment: signature.asc
Description: Digital signature


Reply to: