-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dso导致用户模块的自定义指令无法识别 #76
Comments
Hi,多谢反馈。 dso { events { |
配置了,我的nginx hmux动态编译后,模块运行没有问题。 |
@wangbin579 你使用的是那个版本? 可以使用下master分支上最新的版本再试试。 谢谢! |
应该就是master最新版本。 [root@bgp176_161 sbin]# ./nginx_dso -v |
@wangbin579 你私信里和我说是因为静态编译里已经有这个模块,但是有动态链接了? |
@wangbin579 一个模块只能被加入一次。如果静态和动态都加入了同一模块(根据模块名称来判断),则以静态编译的模块优先。你期待的行为是什么? |
利用静态编译的版本,只是说明配置文件已经有dso配置了 |
你之前静态编译的时候是不是加了--add-module选项把这个模块静态编译进去了,然后又使用编译出来的这个tengine版本加dso选项? |
不是,分开的。 经过试验,如果config中只有一个模块,就不会报unknown directive "xxxxxx" in /usr/local/nginx/etc/nginx.conf:60,多个模块,就有问题 |
我自己试了一下加载多个模块是没问题的。 |
好,我明天搞一个最小测试集,独立出来 |
经过我们测试,如果在config写两个模块的配置,比如 ngx_addon_name=ngx_http_hello_module ngx_addon_name=ngx_http_ok_module 利用dso_tool编译,情况如下:
配置了nginx.conf dso { 运行: [root@bgp176_161 sbin]# ./nginx 其中: ngx_http_hello_module模块(http://blog.zhuzhaoyuan.com/2009/08/creating-a-hello-world-nginx-module/) ngx_http_ok_module把hello改成ok后的模块 |
@wangbin579 是的,现在dso_tools不支持一个config里面写多个module,因为有一个问题很难解决,那就是config里面的NGX_ADDON_SRCS变量,我执行完config之后,无法知道每个模块都需要那些源文件。。除非新创建一个config文件的写法。。不过这个我会再考虑下如何兼容这种情况,因为我们这边有些模块也有这个问题。。 谢谢! |
ngx_addon_name=ngx_http_hello_module 如果dso编译,这样也出现上面同样的问题,如果是静态编译,就没有问题 |
@wangbin579 你如果这样子写,那么dos_tools就更不知道编译.so应该用那个源文件了。。 所以还是推荐你分成两个config。。 谢谢! |
分开确实是一种方法,但对于很多系统,还是很麻烦的 |
@wangbin579 恩,我后续会想想看有其他的解决方法没,这个版本,暂时只能分开了。 谢谢! |
仅仅对用户写的模块进行动态编译,结果发现用户自定义的指令没有被识别。
比如:
Starting nginx: nginx: [emerg] unknown directive "xxxxxx" in /usr/local/nginx/etc/nginx.conf:60
error ...
但如果对用户的模块进行静态编译,运行nginx却没有上述问题
是不是dso编译的时候需要注意点啥?
The text was updated successfully, but these errors were encountered: