tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "George Sexton" <geor...@mhsoftware.com>
Subject RE: Clearing the catalina.out file
Date Fri, 14 Aug 2009 19:21:28 GMT
Here's what I originally wrote and Chris responded to:

> In Unix, if you erase a file that's still open, that file will be removed
> from the directory but it will exist and consume space until the application
> closes it. The holding application can continue to put data in it. So, if
> you want to reset catalina.out you need to re-start tomcat.

You'll note that what I wrote about erasing files is exactly in line with what you just wrote.

Chris responded with:

>> So, if you want to reset catalina.out you need to re-start tomcat.

> No, you don't. Why do people make statements like this? You can try it
> yourself. It takes like 5 seconds:

> $ bin/startup.sh
> (observe log file with messages)
> $ > logs/catalina.out
> (observe empty log file)
> (redeploy an application, or do something that will generate output in
> catalina.out)
> (observe new messages in catalina.out)



If you're going to pull cute shell tricks like truncating a file through re-direction, then
you need to explain what you're doing so people see it.

Without the explanation it looks like an obtuse method of erasing the file. A sentence that
says:

"There's an alternate way of resetting the file via truncation. If you truncate the file,
it works. Here's how:"

Instead of 

"> No, you don't. Why do people make statements like this? You can try it" 


His exasperation clearly comes through and the explanation of why I need to try it isn't present.
I hope that Chris can answer lots of questions, because quite frankly with his approach no
one's going to want to participate after the 2nd or 3rd time they get their crap jumped in
like this. 

 
George Sexton
MH Software, Inc.
http://www.mhsoftware.com/
Voice: 303 438 9585
 

> -----Original Message-----
> From: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com]
> Sent: Friday, August 14, 2009 1:03 PM
> To: Tomcat Users List
> Subject: RE: Clearing the catalina.out file
> 
> > From: George Sexton [mailto:georges@mhsoftware.com]
> > Subject: RE: Clearing the catalina.out file
> >
> > rm catalina.out
> 
> Which is an unlink, not an erase; all the suggestions so far have been
> for truncation.
> 
> An inode and its associated data blocks are never discarded until the
> busy count goes to zero regardless of the link count; this means it
> hangs around until everyone using it has done a close().  For stdout,
> that won't happen until the process terminates or explicit calls are
> made to fiddle with it.
> 
>  - Chuck
> 
> 
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE
> PROPRIETARY MATERIAL and is thus for use only by the intended
> recipient. If you received this in error, please contact the sender and
> delete the e-mail and its attachments from all computers.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message