[原创]FreeBSD10下日志文件中大量pccard_ether的解决_VMware, Unix及操作系统讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  VMware, Unix及操作系统讨论区 »
总帖数
1
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 3407 | 回复: 0   主题: [原创]FreeBSD10下日志文件中大量pccard_ether的解决        下一篇 
wulcan
版主
等级:中校
经验:1795
发帖:124
精华:0
注册:2014-3-19
状态:离线
发送短消息息给wulcan 加好友    发送短消息息给wulcan 发消息
发表于: IP:您无权察看 2014-9-22 21:22:10 | [全部帖] [楼主帖] 楼主

使用mpd做的PPPoE的Server,一台新机器用是FreeBSD10,查看日志,会发现大量的:

Sep 3 06:26:06 vpn devd: Executing '/etc/pccard_ether ng2 start'
Sep 3 07:08:19 vpn devd: Executing '/etc/pccard_ether ng42 start'
Sep 3 07:15:22 vpn devd: Executing '/etc/pccard_ether ng43 start'
Sep 3 07:29:42 vpn devd: Executing '/etc/pccard_ether ng1 start'


由于本机需要开启vlan,所以也有几百个vlan,/var/log/message中,每一个vlan也对应一条日志:

Aug 30 23:04:29 vpn devd: Executing '/etc/rc.d/dhclient quietstart vlan567'
Aug 30 23:04:29 vpn devd: Executing '/etc/rc.d/dhclient quietstart vlan669'
Aug 30 23:04:29 vpn devd: Executing '/etc/rc.d/dhclient quietstart vlan728'
Aug 30 23:04:29 vpn devd: Executing '/etc/rc.d/dhclient quietstart vlan532'


同时,mpd在每天都会自动重启一下,其他FreeBSD9的机器都正常,这台机器时间一长就会出现不重启卡住的情况,导致无法接入PPPoE的拨入。

顺着/etc/pccard_ether和dhclient查找,终于找到产生这些消息的原因是因为devd,devd是一个守护程序,只要硬件发生变化,就会运行相应的程序。

在/etc/devd中,对网卡界面连接消息的配置是:

# NB: DETACH events are ignored; the kernel should handle all cleanup
# (routes, arp cache). Beware of races against immediate create
# of a device with the same name; e.g.
# ifconfig bridge0 destroy; ifconfig bridge0 create
notify 0 {
      match "system" "IFNET";
      match "subsystem" "!usbus[0-9]+";
      match "type" "ATTACH";
      action "/etc/pccard_ether $subsystem start";
};


看上面的解释,所有虚拟界面产生时都会匹配这条项目,所以就会在日志���产生那一大批的pccard_ether。

你可能会比较奇怪为什么叫这个名字,为什么网卡跟pccard发生了关系,注意上面还有一句,说明为什么叫pccard_ether:由于历史的原因,因为最早能热拨插的网卡只有pccard网卡,usb那是后来的事了。

日志中的dhclient呢?在devd.conf后面有定义:

# Try to start dhclient on Ethernet-like interfaces when the link comes
# up. Only devices that are configured to support DHCP will actually
# run it. No link down rule exists because dhclient automatically exits
# when the link goes down.
#
notify 0 {
      match "system" "IFNET";
      match "type" "LINK_UP";
      media-type "ethernet";
      action "/etc/rc.d/dhclient quietstart $subsystem";
};


注意这可能有个bug,给vlan定义了ip,也会产生这个消息,可能是因为ifconfig vlan create的时候,就已经触发了这个消息,然后再ifconfig vlanxx,那就是后来的事了。

禁用devd的方法就简单了,在/etc/rc.conf中添加一行:

devd_enable=”NO”


同时鄙视一下动不动就修改:/etc/default/rc.conf中项目的人。

该贴由hui.chen转至本版2014-11-5 17:04:54




赞(0)    操作        顶端 
总帖数
1
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论