<br>No! For every linux distribution<br><br><div class="gmail_quote">On Fri, Mar 21, 2008 at 4:11 AM, Neil Sheth &lt;<a href="mailto:nsheth@gmail.com">nsheth@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Is this specific to Gentoo?<br>
<div><div></div><div class="Wj3C7c"><br>
On Thu, Mar 20, 2008 at 3:02 AM, Yordan Georgiev &lt;<a href="mailto:y.georgiev@gmail.com">y.georgiev@gmail.com</a>&gt; wrote:<br>
&gt; #!/sbin/runscript<br>
&gt; # Copyright 1999-2004 Gentoo Foundation<br>
&gt; # Distributed under the terms of the GNU General Public License v2<br>
&gt; # $Header: /var/cvsroot/gentoo-x86/www-servers/nginx/files/nginx-r1,v 1.1<br>
&gt; 2006/07/04 16:58:38 voxus Exp $<br>
&gt;<br>
&gt; opts=&quot;${opts} upgrade reload configtest&quot;<br>
&gt;<br>
&gt; depend() {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; need net<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; use dns logger<br>
&gt; }<br>
&gt;<br>
&gt; start() {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; configtest || return 1<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; ebegin &quot;Starting nginx&quot;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;start-stop-daemon --start --pidfile /var/run/nginx.pid \<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --exec /usr/sbin/nginx -- -c /etc/nginx/nginx.conf<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; eend $? &quot;Failed to start nginx&quot;<br>
&gt; }<br>
&gt;<br>
&gt; stop() {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; configtest || return 1<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ebegin &quot;Stopping nginx&quot;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; start-stop-daemon --stop --pidfile /var/run/nginx.pid<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; eend $? &quot;Failed to stop nginx&quot;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; rm -f /var/run/nginx.pid<br>
&gt; }<br>
&gt;<br>
&gt; reload() {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;configtest || return 1<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; ebegin &quot;Refreshing nginx&#39; configuration&quot;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; kill -HUP `cat /var/run/nginx.pid` &amp;&gt;/dev/null<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; eend $? &quot;Failed to reload nginx&quot;<br>
&gt; }<br>
&gt;<br>
&gt; upgrade() {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; configtest || return 1<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; ebegin &quot;Upgrading nginx&quot;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; einfo &quot;Sending USR2 to old binary&quot;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; kill -USR2 `cat /var/run/nginx.pid` &amp;&gt;/dev/null<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; einfo &quot;Sleeping 3 seconds before pid-files checking&quot;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; sleep 3<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; if [ ! -f /var/run/nginx.pid.oldbin ]; then<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; eerror &quot;File with old pid not found&quot;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return 1<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; fi<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; if [ ! -f /var/run/nginx.pid ]; then<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; eerror &quot;New binary failed to start&quot;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return 1<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; fi<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; einfo &quot;Sleeping 3 seconds before WINCH&quot;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sleep 3 ; kill -WINCH `cat /var/run/nginx.pid.oldbin`<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; einfo &quot;Sending QUIT to old binary&quot;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; kill -QUIT `cat /var/run/nginx.pid.oldbin`<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; einfo &quot;Upgrade completed&quot;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; eend $? &quot;Upgrade failed&quot;<br>
&gt; }<br>
&gt;<br>
&gt; configtest() {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; ebegin &quot;Checking nginx&#39; configuration&quot;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; /usr/sbin/nginx -c /etc/nginx/nginx.conf -t<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; eend $? &quot;failed, please correct errors above&quot;<br>
&gt; &nbsp;}<br>
&gt;<br>
&gt;<br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Please excuse my bad english...<br><br>С уважение,<br>Й. Георгиев.<br><br>WEB: <a href="http://gigavolt-bg.net/">http://gigavolt-bg.net/</a><br>Blog: <a href="http://live.gigavolt-bg.net/">http://live.gigavolt-bg.net/</a>