<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>lighty's life: graceful restart</title>
    <link>http://blog.lighttpd.net/articles/2005/09/02/graceful-restart</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>graceful restart</title>
      <description>&lt;p&gt;With lighttpd 1.4.3 it is possible to do a graceful shutdown by sending a &lt;span class="caps"&gt;SIGINT&lt;/span&gt; to the process. It will only shutdown the server after the client connections are closed successfully without interrupting the connections.&lt;/p&gt;


	&lt;p&gt;But can this be used to implement &amp;#8216;reload config on signal&amp;#8217; or &amp;#8216;graceful restart&amp;#8217; ?&lt;/p&gt;
&lt;p&gt;When we added graceful shutdown we kept in mind to allow a graceful restart and reloading the configuration without interrupting running connections in the same run.&lt;/p&gt;


	&lt;p&gt;The idea is the following:&lt;/p&gt;


	&lt;ol&gt;
	&lt;li&gt;the old process gets a &lt;span class="caps"&gt;SIGINT&lt;/span&gt; to close the server sockets and ignore all incoming connections for it, but continues to run until all connections are finished.&lt;/li&gt;
		&lt;li&gt;a new process is started, connects to the unbound server sockets and serves all the new connections.&lt;/li&gt;
	&lt;/ol&gt;


	&lt;p&gt;Up to now the start scripts don&amp;#8217;t implement this, but this is the challenge for you.&lt;/p&gt;


	&lt;p&gt;Please try out if our idea works as planed:&lt;/p&gt;


&lt;pre&gt;
...
   reload)
     killproc -INT $LIGHTTPD_BIN
     $0 start
     ;;
&lt;/pre&gt;

	&lt;p&gt;If your system is &lt;span class="caps"&gt;LSB&lt;/span&gt; conform you should be able to use &lt;a href="http://trac.lighttpd.net/trac/file/branches/lighttpd-merge-1.4.x/doc/rc.lighttpd?rev=686"&gt;the updated rc.lighttpd&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 02 Sep 2005 10:01:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:20731136c132d8385f3b7c13d76ab6a5</guid>
      <author>jan</author>
      <link>http://blog.lighttpd.net/articles/2005/09/02/graceful-restart</link>
      <category>shutdown</category>
      <category>graceful</category>
      <trackback:ping>http://blog.lighttpd.net/articles/trackback/20</trackback:ping>
    </item>
  </channel>
</rss>
