hi agentzh,
发现一个报错,应该与ngx_lua中执行os.execute有关,以下是相关配置
nginx.conf:
---------
user nobody;
worker_processes 8;
worker_rlimit_nofile 65535;
error_log /data/logs/error.log;
pid /data/logs/nginx.pid;
events {
use epoll;
worker_connections 4096;
}
http {
access_log /data/logs/ngx_access.log combined;
error_log /data/logs/ngx_error.log notice;
lua_code_cache off;
server
{
listen 80 default backlog=8192;
location /w {
content_by_lua_file "conf/w.lua";
}
}
}
========================
w.lua 只有两行:
os.execute("/bin/mkdir -p /tmp/xx")
ngx.exit(ngx.HTTP_OK)
每次请求 /usr/bin/curl "
http://localhost/w/x",在 /data/logs/error.log 里会多一条错误日志
2012/09/05 15:25:10 [alert] 13215#0: waitpid() failed (10: No child processes)
这时目标目录已经创建成功了
drwxrwxrwx 2 nobody nobody 4096 Sep 5 15:20 xx
有一个奇怪之处是这个日志写在了全局的 error.log 里,而不是http段的 ngx_error.log里,应该是个bug?
Lance