<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Tech-Recipes - Latest Comments in Restart Apache without closing open connections</title><link>http://tech-recipes.disqus.com/</link><description>Cookbook of Tech Tutorials</description><atom:link href="https://tech-recipes.disqus.com/restart_apache_without_closing_open_connections_apache_web_server_tech_recipes/latest.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Tue, 11 Nov 2003 09:23:56 -0000</lastBuildDate><item><title>Re: Restart Apache without closing open connections</title><link>http://www.tech-recipes.com/rx/110/restart-apache-without-closing-open-connections/#comment-2766935</link><description>&lt;p&gt;Failing to find &lt;strong&gt;apachectl&lt;/strong&gt;, one could just find the PID of the parent httpd process and send a -USR1 signal to it.&lt;/p&gt;&lt;p&gt;For example:&lt;/p&gt;&lt;p&gt;&lt;code&gt;&lt;br&gt;$ ps -ef | grep httpd&lt;br&gt;root     17723     1  0 Sep23 ?        00:00:01 /usr/sbin/httpd -DHAVE_ACCESS -D&lt;br&gt;apache    3666 17723  0 Nov09 ?        00:00:00 /usr/sbin/httpd -DHAVE_ACCESS -D&lt;br&gt;apache    3667 17723  0 Nov09 ?        00:00:00 /usr/sbin/httpd -DHAVE_ACCESS -D&lt;br&gt;apache    3668 17723  0 Nov09 ?        00:00:00 /usr/sbin/httpd -DHAVE_ACCESS -D&lt;br&gt;apache    3669 17723  0 Nov09 ?        00:00:00 /usr/sbin/httpd -DHAVE_ACCESS -D&lt;br&gt;apache    3670 17723  0 Nov09 ?        00:00:00 /usr/sbin/httpd -DHAVE_ACCESS -D&lt;br&gt;apache    3671 17723  0 Nov09 ?        00:00:00 /usr/sbin/httpd -DHAVE_ACCESS -D&lt;br&gt;apache    3672 17723  0 Nov09 ?        00:00:00 /usr/sbin/httpd -DHAVE_ACCESS -D&lt;br&gt;apache    3673 17723  0 Nov09 ?        00:00:00 /usr/sbin/httpd -DHAVE_ACCESS -D&lt;br&gt;&lt;br&gt;$ kill -USR1 17723&lt;br&gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;a -USR1 signal will cause any new children to run with a new configuration, but leave the current children running as-is.  A -HUP signal will kill off all current children and cause new requests to be serviced under the new configuration.&lt;/p&gt;&lt;p&gt;Of course, one could be a little more sophisticated:&lt;/p&gt;&lt;p&gt;&lt;code&gt;&lt;br&gt;&lt;br&gt;$ ps -ef | grep httpd | grep root | awk '{print $2}' | xargs kill -HUP&lt;br&gt;&lt;br&gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;That said, apachectl is a lot cleaner.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">bofh468</dc:creator><pubDate>Tue, 11 Nov 2003 09:23:56 -0000</pubDate></item></channel></rss>