免费注册 查看新帖 |

Chinaunix

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

高难问题求解 kernel: printk: 2 messages suppressed. [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-02-27 17:19 |只看该作者 |倒序浏览
我的linux服务器最近apache服务总是被攻击,时间长了就死机。
去机房看,屏幕一堆错误代码,显示内存,swap都已经占满。
ssh, ftp包括终端登陆,一概进不去。
重启就好了,然后我发现只要启动apache,就会有这类信息出现:
(环境: fedora2 or centos5.1, httpd-2.2.3)

[root@www1 log]# tail messages
Feb 27 17:02:12 www1 kernel: printk: 2 messages suppressed.
Feb 27 17:02:17 www1 kernel: printk: 3 messages suppressed.
Feb 27 17:02:23 www1 kernel: printk: 2 messages suppressed.
Feb 27 17:02:31 www1 kernel: printk: 3 messages suppressed.
Feb 27 17:02:37 www1 kernel: printk: 6 messages suppressed.
Feb 27 17:02:41 www1 kernel: printk: 1 messages suppressed.
Feb 27 17:02:48 www1 kernel: printk: 7 messages suppressed.
Feb 27 17:02:52 www1 kernel: printk: 3 messages suppressed.
Feb 27 17:03:00 www1 kernel: printk: 4 messages suppressed.
Feb 27 17:03:02 www1 kernel: printk: 1 messages suppressed.

找了好多资料,没发现有解决办法,哪位高人能帮忙啊? 多谢!

相关内核代码:
/*
 * This enforces a rate limit: not more than one kernel message
 * every 5secs to make a denial-of-service attack impossible.
 *
 * All warning printk()s should be guarded by this function.
 */

int net_ratelimit(void)
{
    static spinlock_t ratelimit_lock = SPIN_LOCK_UNLOCKED;
    static unsigned long toks = 10*5*HZ;
    static unsigned long last_msg;
    static int missed;
    unsigned long flags;
    unsigned long now = jiffies;

    spin_lock_irqsave(&ratelimit_lock, flags);
    toks += now - last_msg;
    last_msg = now;
    if (toks > net_msg_burst)
        toks = net_msg_burst;
    if (toks >= net_msg_cost) {
        int lost = missed;
        missed = 0;
        toks -= net_msg_cost;
        spin_unlock_irqrestore(&ratelimit_lock, flags);
        if (lost)
            printk(KERN_WARNING "NET: %d messages suppressed.
"
, lost);
        return 1;
    }
    missed++;
    spin_unlock_irqrestore(&ratelimit_lock, flags);
    return 0;
}

论坛徽章:
0
2 [报告]
发表于 2008-02-29 14:51 |只看该作者
http://www.wittsend.com/mhw/vitae.html
这位大牛是这么回复的: 等死机了再把信息发给他看看吧,我是解决不了了。估计根原因不是这个。

Ignore the "messages suppressed" messages.  They are normal when
something is trying to printk a kernel message repeatedly.  You want the
message that's being suppressed.  That will be the last message in your
messages file just before the "messages suppressed" message.  The
"suppressed" messages merely mean that something is trying to generate a
whole lot of kernel printk's and you need to find out what that is.
...............
.....
Ignore the "suppressed messages" messages.  They are not the problem.
That's normal when you have a flood of kernel printk's.  What you need
to find out is the last message just before the first "suppressed
messages" message.

论坛徽章:
0
3 [报告]
发表于 2008-02-29 22:34 |只看该作者
楼上的帖子是超级偶像,+++++++++++++++++++++++

论坛徽章:
0
4 [报告]
发表于 2011-10-08 15:41 |只看该作者
我要答案啊哥!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP