frequently ask ? : Computers : Internet : Web Servers : Apache

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

7 of 8 people (88%) answered Yes
Recently 7 of 8 people (88%) answered Yes

Entry

I started using piped logs on my webserver, apachectl restart leaves just one httpd process. Why?

Nov 5th, 2001 04:50
Neil Hamilton,


OK, I've now found the answer to this.
When you do an apachectl restart or apachectl graceful, a sigHUP or 
sigUSR1 are sent to your logging script. Your script needs to watch out 
for this, and exit if it receives one, as the main httpd daemon won't 
exit till all the subprocesses have gone.
To do this in a PERL, you just need to add the following lines near the 
beginning of your custom logging script:
#Set signal handlers for restart
$SIG{'HUP'}=sub{exit};
$SIG{'USR1'}=sub{exit};