in reply to Modifying a log(text) file being written to by another process.

What is happening is that you are writing to the same file that the webserver has an open file handle for. AFAIK, the inodes do not change, you are clobbering the same file while it is opened by the webserver. This is dangerous and poorly designed. What you want is log rotation. Most webservers provide a method to rotate the logs. Apache has apachectl graceful. I recommend that you look into this method to rather than clobbering open files out from under your web server processes.

HTH

  • Comment on Re: Modifying a log(text) file being written to by another process.

Replies are listed 'Best First'.
Re: Re: Modifying a log(text) file being written to by another process.
by uffda (Initiate) on May 27, 2003 at 21:23 UTC
    Thanks for your reply.
    Unfortunately, the reason I'm doing this at all is because the log rotation process fails randomly and without explanation for our IPlanet servers (using ns-cron). This process I described is only being used when normal log rotation fails for a particular instance.