Re: Windows rotatelogs, cmd.exe permission

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Jul 8, 2009, at 11:09 AM, Philip J Dicke wrote:

Windows does not seem to have the "apachectl graceful" command that unix does. The only solution that I see is to run apache, where it writes straight to a log file, write a script that shuts down httpd, moves the log file and restarts
httpd.


I've had good success using the following approach:

1) move the logfiles(s) to a new name, with a timestamp or whatever
2) Send httpd.exe -n ServiceName -k graceful (wrowe tells us that restart and graceful are the same thing on Windows) 3) Wait a second, a minute, an hour or whatever you need to make sure the old httpd child has in fact gone away and has stopped writing to the open file descriptor of the old logfile. 4) Do what you need to do to the old logfile (compress, explode into vhosts, analyze, whatever, it's yours now)

The fact that httpd keeps writing to the old logfile ensures that you don't miss any log entries, and the graceful restart ensures uninterrupted service. As wrowe says, the service interface only knows to kill the program under consideration entirely, and then start it up again. This is obviously too harsh if you expect to keep serving requests, and fortunately not necessary.

S.

--
Sander Temme
sctemme@xxxxxxxxxx
PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF



Attachment: smime.p7s
Description: S/MIME cryptographic signature


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux