Thanks for that. I did wonder about this method, but the first time I did
this some of our log files were huge (>350MB). I've never been that
knowledgeable about inodes, even though I've written C shells in the past. I
think the penny has kind of dropped now. So basically you can move the files
whilst they are being written to, because their inodes don't change. Then
send a -SIGHUP to the main apache process to create new files (and inodes)
in the original directory.
I'll try this method the next time we move log files. Do I assume correctly
that
/etc/rc.d/init.d/httpd reload
Does a graceful restart also?
-
John Airey
Internet Systems Support Officer, ITCSD, Royal National Institute for the
Blind,
Bakewell Road, Peterborough PE2 6XU,
Tel.: +44 (0) 1733 375299 Fax: +44 (0) 1733 370848 [EMAIL PROTECTED]
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: 06 April 2001 13:38
> To: [EMAIL PROTECTED]
> Subject: RE: Apache mod_ssl and openssl - I messed up
>
>
> > 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]
>
______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl) www.modssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]