免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 16805 | 回复: 5
打印 上一主题 下一主题

[Web] nginx 启动时提示 invalid event type "epoll" [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-06-05 15:22 |只看该作者 |倒序浏览
内核是由redhat9 的 2.4.20 升级到现在的 2.6.18

nginx configure 的结果如下:
[root@localhost nginx-0.8.36]# ./configure --user=www --group=www --prefix=/data/app/nginx --with-openssl=/usr/include --with-http_stub_status_module
checking for OS
+ Linux 2.6.18 i686
checking for C compiler ... found
+ using GNU C compiler
+ gcc version: 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
checking for gcc -pipe switch ... found
checking for gcc builtin atomic operations ... not found
checking for gcc variadic macros ... found
checking for C99 variadic macros ... found
checking for unistd.h ... found
checking for inttypes.h ... found
checking for limits.h ... found
checking for sys/filio.h ... not found
checking for sys/param.h ... found
checking for sys/mount.h ... found
checking for sys/statvfs.h ... found
checking for crypt.h ... found
checking for Linux specific features
checking for epoll ... not found
checking for sendfile() ... found
checking for sendfile64() ... found
checking for sys/prctl.h ... found
checking for prctl(PR_SET_DUMPABLE) ... found
checking for sched_setaffinity() ... not found
checking for crypt_r() ... found
checking for sys/vfs.h ... found
checking for poll() ... found
checking for /dev/poll ... not found
checking for kqueue ... not found
checking for crypt() ... not found
checking for crypt() in libcrypt ... found
checking for F_READAHEAD ... not found
checking for posix_fadvise() ... found
checking for O_DIRECT ... found
checking for F_NOCACHE ... not found
checking for directio() ... not found
checking for statfs() ... found
checking for statvfs() ... found
checking for dlopen() ... not found
checking for dlopen() in libdl ... found
checking for sched_yield() ... found
checking for PCRE library ... found
checking for system md library ... not found
checking for system md5 library ... not found
checking for OpenSSL md5 crypto library ... found
checking for zlib library ... found
creating objs/Makefile
checking for int size ... 4 bytes
checking for long size ... 4 bytes
checking for long long size ... 8 bytes
checking for void * size ... 4 bytes
checking for uint64_t ... found
checking for sig_atomic_t ... found
checking for sig_atomic_t size ... 4 bytes
checking for socklen_t ... found
checking for in_addr_t ... found
checking for in_port_t ... found
checking for rlim_t ... found
checking for uintptr_t ... uintptr_t found
checking for system endianess ... little endianess
checking for size_t size ... 4 bytes
checking for off_t size ... 8 bytes
checking for time_t size ... 4 bytes
checking for setproctitle() ... not found
checking for pread() ... found
checking for pwrite() ... found
checking for strerror_r() ... found but is not working
checking for gnu style strerror_r() ... found
checking for sys_errlist[] ... found
checking for localtime_r() ... found
checking for posix_memalign() ... found
checking for memalign() ... found
checking for mmap(MAP_ANON|MAP_SHARED) ... found
checking for mmap("/dev/zero", MAP_SHARED) ... found
checking for System V shared memory ... found
checking for struct msghdr.msg_control ... found
checking for ioctl(FIONBIO) ... found
checking for struct tm.tm_gmtoff ... found
checking for struct dirent.d_namlen ... not found
checking for struct dirent.d_type ... found

Configuration summary
  + using system PCRE library
  + using OpenSSL library: /usr/include
  + md5: using system crypto library
  + sha1 library is not used
  + using system zlib library

  nginx path prefix: "/data/app/nginx"
  nginx binary file: "/data/app/nginx/sbin/nginx"
  nginx configuration prefix: "/data/app/nginx/conf"
  nginx configuration file: "/data/app/nginx/conf/nginx.conf"
  nginx pid file: "/data/app/nginx/logs/nginx.pid"
  nginx error log file: "/data/app/nginx/logs/error.log"
  nginx http access log file: "/data/app/nginx/logs/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"

中间发现 有个 checking for epoll ... not found
大家知道怎么解决吗?

论坛徽章:
0
2 [报告]
发表于 2010-06-05 16:26 |只看该作者
没可能的啊
2.6的内核应该都有epoll机制的啊
要不你试试装装其他的发行版本的2.6系统

EPOLL does not exist in Red Hat Enterprise Linux version 3. This is a feature of the 2.6 kernel. Red Hat Enterprise Linux version 3 is based on the 2.4 Linux kernel. The EPOLL functionality was unable to be back-ported to the 2.4 kernel due to issues with maintenance of the Application Binary Interface (ABI).
EPOLL should be available in versions of Red Hat Enterprise Linux that use the 2.6 kernel or later, such as Red Hat Enterprise Linux 4. The Red Hat Enterprise Linux 4 ISO files are available to download to subscribers from Red Hat Network (RHN).

论坛徽章:
0
3 [报告]
发表于 2010-06-05 17:20 |只看该作者
RedHat 9.0的glibc库版本太老,不支持epoll这个api。而且出于兼容性的考虑,不建议你升级glibc库到新版本,以免其他程序运行出错。如果你必须用RedHat这么老的版本的话,你只能用以下形式直接调用glibc底层_syscall1 _syscall3 _syscall4来使用epoll

  1. #define __sys_epoll_create(maxfds) _syscall1(int, sys_epoll_create, int, maxfds)
  2. #define __sys_epoll_ctl(epfd, op, fd, events) _syscall4(int, sys_epoll_ctl, \
  3.                                              int, epfd, int, op, int, fd, unsigned int, events)
  4. #define __sys_epoll_wait(epfd, events, timeout) _syscall3(int, sys_epoll_wait, \
  5.                                              int, epfd, struct pollfd **, events, int, timeout)
复制代码
sys_epoll_create sys_epoll_ctl sys_epoll_wait的内核常量值在对应内核的源码里查。比较老的内核应该是

  1. #define __NR_sys_epoll_create  254
  2. #define __NR_sys_epoll_ctl     255
  3. #define __NR_sys_epoll_wait    256
复制代码

论坛徽章:
0
4 [报告]
发表于 2010-06-05 17:22 |只看该作者
楼主如果要通过configure的测试的话,还要读一下configure的错误日志,补上需要的.h文件以便测试能通过。

论坛徽章:
0
5 [报告]
发表于 2010-06-05 18:00 |只看该作者
好的,下了一个 CentOS5 正在测试。
谢谢大家

论坛徽章:
0
6 [报告]
发表于 2010-06-06 09:15 |只看该作者
readhat 9 是上古时候的东西,还真有人在用啊
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP