Hi,<br><br>I find &quot;reload&quot; can get the job done.<br><br>But if I wantt o enable #gzip&nbsp; on; , I still need to reboot the server after I changed the conf file (I am not 100% sure about this, but all my stuffs working after I reboot the server, I can&#39;t just use &quot;reload&quot; comand to get it works&quot;). <br>
<br>At first, I just think the restart process is just like apache, but nginx really does it better. You can archive zero downtime time if you restart it correctly :-).<br><br>Max<br><br><div class="gmail_quote">On Thu, Feb 19, 2009 at 12:18 AM, Ian Hobson <span dir="ltr">&lt;<a href="mailto:ian@ianhobson.co.uk">ian@ianhobson.co.uk</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">Igor Sysoev wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Have not Linux init scripts a &quot;reload&quot; option to gracefully restart service<br>
using -HUP ?<br>
<br>
 &nbsp;<br>
</blockquote></div>
Hi,<br>
<br>
I use the following under Ubuntu - and restart works fine since I changed the sleep 1 to sleep 2.<br>
<br>
This is /etc/init.d/nginx &nbsp;- you will need to chmod +x /etc/init.d/nginx before &nbsp;use.<br>
<br>
#! /bin/sh<br>
### BEGIN INIT INFO<br>
# Provides: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nginx<br>
# Required-Start: &nbsp; &nbsp;$all<br>
# Required-Stop: &nbsp; &nbsp; $all<br>
# Default-Start: &nbsp; &nbsp; 2 3 4 5<br>
# Default-Stop: &nbsp; &nbsp; &nbsp;0 1 6<br>
# Short-Description: starts the nginx web server<br>
# Description: &nbsp; &nbsp; &nbsp; starts nginx using start-stop-daemon<br>
### END INIT INFO<br>
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin<br>
DAEMON=/usr/sbin/nginx<br>
NAME=nginx<br>
DESC=nginx<br>
test -x $DAEMON || exit 0<br>
# Include nginx defaults if available<br>
if [ -f /etc/default/nginx ] ; then<br>
 &nbsp; . /etc/default/nginx<br>
fi<br>
set -e<br>
case &quot;$1&quot; in<br>
&nbsp;start)<br>
 &nbsp; echo -n &quot;Starting $DESC: &quot;<br>
 &nbsp; start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS<br>
 &nbsp; echo &quot;$NAME.&quot;<br>
 &nbsp; ;;<br>
&nbsp;stop)<br>
 &nbsp; echo -n &quot;Stopping $DESC: &quot;<br>
 &nbsp; start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid --exec $DAEMON<br>
 &nbsp; echo &quot;$NAME.&quot;<br>
 &nbsp; ;;<br>
&nbsp;restart|force-reload)<br>
 &nbsp; echo -n &quot;Restarting $DESC: &quot;<br>
 &nbsp; start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid --exec $DAEMON<br>
 &nbsp; sleep 2<br>
 &nbsp; start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS<br>
 &nbsp; echo &quot;$NAME.&quot;<br>
 &nbsp; ;;<br>
&nbsp;reload)<br>
 &nbsp; &nbsp; echo -n &quot;Reloading $DESC configuration: &quot;<br>
 &nbsp; &nbsp; start-stop-daemon --stop --signal HUP --quiet --pidfile /var/run/$NAME.pid --exec $DAEMON<br>
 &nbsp; &nbsp; echo &quot;$NAME.&quot;<br>
 &nbsp; &nbsp; ;;<br>
&nbsp;*)<br>
 &nbsp; N=/etc/init.d/$NAME<br>
 &nbsp; echo &quot;Usage: $N {start|stop|restart|reload|force-reload}&quot; &gt;&amp;2<br>
 &nbsp; exit 1<br>
 &nbsp; ;;<br>
esac<br>
exit 0<br>
<br>
regards<br><font color="#888888">
<br>
Ian<br>
<br>
</font></blockquote></div><br>