0

希望这很简单,但也许不是。

我在负载均衡器后面设置了4 个RHEL5网络盒。所有人都通过共享来提供大部分内容NFS

偶尔(一天两次或更少)我会在内核的 syslog 中看到一条关于 apache 段错误的注释:

/var/log/messages.2:Sep 13 14:09:14 20050lpweb01 kernel: httpd[10006]: segfault at 00007fffae2eede8 rip 00002ab21a4045d4 rsp 00007fffae2eedd0 error 6

有时,这也伴随着 apache 错误日志的消息,但并非总是如此:

# grep -ic seg /var/log/messages* |egrep -v '0$'
/var/log/messages.2:1
/var/log/messages.3:2
/var/log/messages.4:4
# zgrep -ic seg /var/log/httpd/error_log* |egrep -v '0$'
/var/log/httpd/error_log:1
/var/log/httpd/error_log.10.gz:1
/var/log/httpd/error_log.17.gz:1
/var/log/httpd/error_log.19.gz:1
/var/log/httpd/error_log.23.gz:1
/var/log/httpd/error_log.24.gz:2
/var/log/httpd/error_log.25.gz:1
/var/log/httpd/error_log.28.gz:2
/var/log/httpd/error_log.30.gz:1
/var/log/httpd/error_log.31.gz:1
/var/log/httpd/error_log.35.gz:1
/var/log/httpd/error_log.39.gz:4
/var/log/httpd/error_log.42.gz:1
/var/log/httpd/error_log.44.gz:3
/var/log/httpd/error_log.46.gz:1

我已经按照整个网络的说明设置了核心转储:

echo "ulimit -c unlimited >/dev/null 2>&1" >> /etc/profile
echo "DAEMON_COREFILE_LIMIT='unlimited'" >> /etc/sysconfig/init
echo 1 > /proc/sys/fs/suid_dumpable
echo "core.%p" > /proc/sys/kernel/core_pattern
echo "CoreDumpDirectory /home/coredump" > /etc/httpd/conf.d/core_dumps.conf
mkdir /home/coredump
chown apache: /home/coredump
source /etc/profile
service httpd stop
service httpd start

当我“诱导”一个段错误(kill -11)时,会生成核心转储:

/var/log/httpd/error_log:[Sat Sep 15 20:43:32 2012] [notice] child pid 20746 exit signal Segmentation fault (11), possible coredump in /home/coredumps

但是当段错误自行发生时,不会进行核心转储:

/var/log/httpd/error_log:[Sat Sep 15 12:03:44 2012] [notice] child pid 10652 exit signal Segmentation fault (11)

为什么会发生这种情况?如何确保每次都发生核心转储?

我们正在运行PHP 5.2,但除此之外,一切都是从标准RHELEPEL 存储库安装的。

4

0 回答 0