Processed: Re: Bug#285871: xdm logrotate script eats logs

2005-04-07 Thread Debian Bug Tracking System
Processing commands for [EMAIL PROTECTED]:

 clone 285871 -1 -2
Bug#285871: xdm: logrotate script eats logs
Bug 285871 cloned as bugs 303688-303689.

 retitle 285871 xdm: logrotate script needs improvement
Bug#285871: xdm: logrotate script eats logs
Changed Bug title.

 severity 285871 normal
Bug#285871: xdm: logrotate script needs improvement
Severity set to `normal'.

 retitle -1 xdm: incapable of reopening its logfile, preventing sane log 
 rotation
Bug#303688: xdm: logrotate script eats logs
Changed Bug title.

 retitle -2 xdm: sets up signal handlers that call unsafe functions
Bug#303689: xdm: logrotate script eats logs
Changed Bug title.

 tag -1 = upstream
Bug#303688: xdm: incapable of reopening its logfile, preventing sane log 
rotation
There were no tags set.
Tags set to: upstream

 tag -2 = upstream
Bug#303689: xdm: sets up signal handlers that call unsafe functions
There were no tags set.
Tags set to: upstream

 thanks
Stopping processing here.

Please contact me if you need assistance.

Debian bug tracking system administrator
(administrator, Debian Bugs database)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#285871: xdm logrotate script eats logs

2005-04-07 Thread Branden Robinson
clone 285871 -1 -2
retitle 285871 xdm: logrotate script needs improvement
severity 285871 normal
retitle -1 xdm: incapable of reopening its logfile, preventing sane log rotation
retitle -2 xdm: sets up signal handlers that call unsafe functions
tag -1 = upstream
tag -2 = upstream
thanks

On Fri, Mar 25, 2005 at 11:26:17PM +, 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:
 
 [EMAIL PROTECTED]:~$ ls -l /var/log/xdm.log*
 -rw-r-  1 root adm0 Mar 25 23:16 /var/log/xdm.log
 -rw-r-  1 root adm 1573 Mar 25 23:16 /var/log/xdm.log.1.gz
 
 [EMAIL PROTECTED]:~$ sudo lsof | grep var/log/xdm
 xdm1965  root2w  REG3,6   8376 179574 
 /var/log/xdm.log.1 (deleted)
 XFree862023  root2w  REG3,6   8376 179574 
 /var/log/xdm.log.1 (deleted)
 xdm2024  root2w  REG3,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.

Fixing this doesn't require just an updated logrotate script; in fact, xdm
never reopens its log file (which is just stderr dup2()ed).

While looking further into this (with some help from Andrew Suffield and
Adam Heath on IRC), I learned that signal handling in general in xdm
appears to be done a bit carelessly -- signal handlers call functions that
are not guaranteed to be safe (like vsnprintf(), which is used by the
logging functions like Debug() and LogInfo() in error.c, and called from
signal handlers like RescanNotify() in dm.c).

The quick-and-dirty way to fix this is just to bolt a new signal handler
onto xdm, for SIGUSR2 (SIGUSR1 is already used internally by xdm as a crude
means of IPC between a parent xdm daemon and its children).

The good way to fix this is to do the above and tidy up xdm's signal
handling in general while I'm at it, but the code has nice(?) features like
nonlocal exits from signal handlers, and I'm going to have to curl up with
_APUE_ before I can make much more progress on that front.  I'll also very
much want someone to audit my changes.  With the sarge freeze imminent, I'm
afraid the quick-and-dirty fix may be the only feasible one for the time
being.

-- 
G. Branden Robinson| Humor is a rubber sword -- it
Debian GNU/Linux   | allows you to make a point without
[EMAIL PROTECTED] | drawing blood.
http://people.debian.org/~branden/ | -- Mary Hirsch


signature.asc
Description: Digital signature


Processed: Re: Bug#285871: xdm logrotate script eats logs

2005-03-25 Thread Debian Bug Tracking System
Processing commands for [EMAIL PROTECTED]:

 tag 285871 + unreproducible moreinfo
Bug#285871: xdm logrotate script eats logs
There were no tags set.
Tags added: unreproducible, moreinfo

 retitle 285871 xdm: logrotate script eats logs
Bug#285871: xdm logrotate script eats logs
Changed Bug title.

 thanks
Stopping processing here.

Please contact me if you need assistance.

Debian bug tracking system administrator
(administrator, Debian Bugs database)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#285871: xdm logrotate script eats logs

2005-03-25 Thread Branden Robinson
tag 285871 + unreproducible moreinfo
retitle 285871 xdm: logrotate script eats logs
thanks

On Thu, Dec 16, 2004 at 02:40:00AM +, Andrew Suffield wrote:
 Package: xdm
 Severity: important
 
 /etc/logrotate.d/xdm manages to delete the /var/log/xdm.log currently
 in use, and never signals xdm to reopen its log file. Since xdm
 usually stays running for weeks at a time, and the log is 'rotated'
 daily, this means that most of the time xdm is writing to a deleted
 file. Which is less than helpful.

I've never seen this behavior.

 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
}

-- 
G. Branden Robinson|   Psychology is really biology.
Debian GNU/Linux   |   Biology is really chemistry.
[EMAIL PROTECTED] |   Chemistry is really physics.
http://people.debian.org/~branden/ |   Physics is really math.


signature.asc
Description: Digital signature


Bug#285871: xdm logrotate script eats logs

2005-03-25 Thread Andrew Suffield
On Fri, Mar 25, 2005 at 05:55:02PM -0500, Branden Robinson wrote:
 On Thu, Dec 16, 2004 at 02:40:00AM +, Andrew Suffield wrote:
  Package: xdm
  Severity: important
  
  /etc/logrotate.d/xdm manages to delete the /var/log/xdm.log currently
  in use, and never signals xdm to reopen its log file. Since xdm
  usually stays running for weeks at a time, and the log is 'rotated'
  daily, this means that most of the time xdm is writing to a deleted
  file. Which is less than helpful.
 
 I've never seen this behavior.

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:

[EMAIL PROTECTED]:~$ ls -l /var/log/xdm.log*
-rw-r-  1 root adm0 Mar 25 23:16 /var/log/xdm.log
-rw-r-  1 root adm 1573 Mar 25 23:16 /var/log/xdm.log.1.gz

[EMAIL PROTECTED]:~$ sudo lsof | grep var/log/xdm
xdm1965  root2w  REG3,6   8376 179574 
/var/log/xdm.log.1 (deleted)
XFree862023  root2w  REG3,6   8376 179574 
/var/log/xdm.log.1 (deleted)
xdm2024  root2w  REG3,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.

  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
}

-- 
  .''`.  ** Debian GNU/Linux ** | Andrew Suffield
 : :' :  http://www.debian.org/ |
 `. `'  |
   `- --  |


signature.asc
Description: Digital signature


Bug#285871: xdm logrotate script eats logs

2004-12-15 Thread Andrew Suffield
Package: xdm
Severity: important

/etc/logrotate.d/xdm manages to delete the /var/log/xdm.log currently
in use, and never signals xdm to reopen its log file. Since xdm
usually stays running for weeks at a time, and the log is 'rotated'
daily, this means that most of the time xdm is writing to a deleted
file. Which is less than helpful.

That's the worst logrotate file I've seen in quite a while.

-- 
  .''`.  ** Debian GNU/Linux ** | Andrew Suffield
 : :' :  http://www.debian.org/ |
 `. `'  |
   `- --  |


signature.asc
Description: Digital signature