<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">On 27 Apr 2016, at 18:51, 洪志道 <<a href="mailto:hongzhidao@gmail.com">hongzhidao@gmail.com</a>> wrote:<br><div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Thanks for your reply.<div><br></div><div>Is it the only way to solve the problem?</div></div></blockquote><div><br></div><div>This is a way to reload a module in production without service interruption.</div><br><blockquote type="cite"><div dir="ltr"><div>I think it will be common that developers try to use dso instead of static module.</div></div></blockquote><div><br></div><div>Developers can simply stop and start nginx again.</div><div><br></div><div>-- </div><div><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Igor Sysoev<br><a href="http://nginx.com">http://nginx.com</a></div></div></div></div><div><br class="webkit-block-placeholder"></div></div><blockquote type="cite"><div dir="ltr"><div>Nginx offical site points out we could load in so modules using reload or restart, but it seems forget to instruct the details about reload.</div><div>And it's a great design, thanks again.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-04-27 19:22 GMT+08:00 Igor Sysoev <span dir="ltr"><<a href="mailto:igor@sysoev.ru" target="_blank">igor@sysoev.ru</a>></span>:<br><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto;"><div style="word-wrap:break-word"><span class="">On 27 Apr 2016, at 12:10, 洪志道 <<a href="mailto:hongzhidao@gmail.com" target="_blank">hongzhidao@gmail.com</a>> wrote:<br></span><div><br><blockquote type="cite"><div dir="ltr"><span class="">Hi,<div><br></div><div>for example following config:</div><div><br></div><div>daemon on;</div><div>...</div><div>load_module modules/ngx_http_test_module.so;</div><div>...</div><div><br></div><div>> start nginx</div><div>> change ngx_http_test_module.c, then regenerate so file</div><div>> kill -HUP pid</div><div><br></div><div>I found nginx still run the old so file (load first time), and how to work with new so file?</div><div><br></div></span><div>I tried .../sbin/nginx -s reload, It works as I expected. It seems there is some differences in 'kill -HUP' and 'sbin/nginx -s reload’;</div></div></blockquote><br></div><div>kill -USR2 `cat nginx.pid`; sleep 2; kill -QUIT `cat nginx.pid.oldbin`</div><span class="HOEnZb"><font color="#888888"><div><div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;"><div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;"><div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;"><br><br>-- <br>Igor Sysoev<br><a href="http://nginx.com/" target="_blank">http://nginx.com</a></div></div></div>
</div>
</font></span></div></blockquote></div></div></blockquote></div><br></body></html>