> 3. I'm moving log files. I usually stop the
> server, move the log files out and start the server. It takes about 20
> seconds each time. I believe there is another way to do this, but
> moving files whilst they are being written to kind of scares me...


I've been doing it  _another way_  for quite some time.


   mv old_access_log_filename new_access_log_filename
   mv old_error_log_filename new_error_log_filename
   ...
   ...
   ...


The program has an inode open, not the file name, so it continues to
write to the old files.

   apachectl graceful    or   kill -USR1 apache-pid

Any apache processes currently serving users continue with the current
request and die.  Processes that are waiting for a request die
instantly, and all are replaced with new processes.  Something (I don't
know if it is the master Apache process, or the first new child) will
create a new set of log files, and all new processes will use them.

I do it at midnight each day, when traffic is low, but my understanding
of a graceful restart is that there is no downtime at all.


This also works for syslog files.  You must kill -HUP the syslog process
to have it re-create the new log files for the day.  It also blindly
keeps writing the old files till the restart signal is sent.



 

Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com
______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      [EMAIL PROTECTED]
Automated List Manager                            [EMAIL PROTECTED]

Reply via email to