I've been reading this thread with much interest. It was my understanding
that you can safely do
cat /dev/null > file
and not destroy the inode, so why can't logrotate (or anything
else) simply do
cp file file.1
cat /dev/null > file
as a rotation scheme without restarting or signaling the process that is
writing to the file?
thanks
charles
On Wed, 19 Jan 2000, Bret Hughes 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. 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?
>
> Bret
>
> Steve Borho wrote:
> >
> >
> > >From what I understand, logrotate depends on the ability to either restart
> > the daemon writing to the file, or being able to send it a signal to tell
> > it to re-open it's file handles.
> >
> > The way Unix works is if a process is writing to a file, even if you delete
> > it, the file doesn't go away until the process closes the file.
--
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.