Good to know also.  I tried the cat /dev/null > logfile technique and
while I did not loos any data there is about 4K or so of garbage at the
begining of the logfile.  In less it shows up as all '@' (noquotes)
symbols.

Does not look good for the cat  dev/null > technique.  I am going to use
the logrotate any way but was hoping to learn something.  I guess I did,
just not what I was hoping :-)

Thanks again

Bret


Tom Gilbert wrote:
> 
> * Bret Hughes ([EMAIL PROTECTED]) wrote:
> > There appears to be a copy and truncate functions that never acually
> > closes or deletes the file.  The man page talks about it being there for
> > programs that cannot be restarted.  That is what prompted my question.
> > I have not had a chance to try it yet though.  Probably try to get to it
> > next week.
> >
> > I was wondering how the file handle thing worked.  I deleted the file
> > and it did disappear from ls but the shell the jre was running in did
> > not crash and I am wondering why not.
> 
> Part of the way the unix file system standard works is that a file is
> not removed from the disk until all programs have finished with it. An
> unlink()ed file hangs around until all apps have close()ed it.
> 
> > Makes sense if the file is not
> > really gone and the shell is still writing to it.  Any ideas how to tell
> > what file handles a program has via the OS?
> 
> All logrotate needs to do is copy the log to another file and truncate
> it by open()ing it with in "write but don't append mode".
> 
> The file is truncated safely. The delay between the end of the copy
> and the truncate is so small that its very unlikely you would lose
> even one character of output under heavy load.
> 
> Tom.
> --
>             .-------------------------------------------------------.
>     .^.     | Tom Gilbert, England | [EMAIL PROTECTED] |
>     /V\     |----------------------| www.tomgilbert.freeserve.co.uk |
>    // \\    | Sites I recommend:   `--------------------------------|
>   /(   )\   | www.freshmeat.net www.enlightenment.org slashdot.org  |
>    ^^-^^    `-------------------------------------------------------'
> 
> --
> To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
> as the Subject.
begin:vcard 
n:Hughes;Bret 
tel;fax:918.587.0131
tel;work:918.587.0131
x-mozilla-html:FALSE
url:www.elevating.com
org:Elevating Communications Inc
adr:;;PO Box 1323;Tulsa;OK;74101-1323;USA
version:2.1
email;internet:[EMAIL PROTECTED]
title:Chief Solutionist/President
x-mozilla-cpt:;19888
fn:Bret  Hughes
end:vcard

Reply via email to