加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – udev中的udev规则

发布时间:2020-12-14 02:34:58 所属栏目:Linux 来源:网络整理
导读:我在Ubuntu 12.04中为我的APC UPS设置了一些udev规则,我使用附带的* -net.rules作为参考.当我在我的-ups.rules中使用ATTR {} ==“”匹配但它不起作用时,我不得不切换到ATTRS {} ==“”以使其工作. 现在我想知道: 在eth0和eth1的udev规则中构建的系统是否已
我在Ubuntu 12.04中为我的APC UPS设置了一些udev规则,我使用附带的* -net.rules作为参考.当我在我的-ups.rules中使用ATTR {} ==“”匹配但它不起作用时,我不得不切换到ATTRS {} ==“”以使其工作.

现在我想知道:

>在eth0和eth1的udev规则中构建的系统是否已损坏?
>他们应该使用ATTRS代替ATTR吗?
>我如何检查以确保它们正常工作?
>我如何列出网络设备的ATTRS?我找不到运行udevadm的设备节点.

解决方法

看看udev的手册页:
ATTR{filename}
       Match sysfs attribute values of the event device. Trailing
       whitespace in the attribute values is ignored,if the specified
       match value does not contain trailing whitespace itself.

VS

ATTRS{filename}
       Search the devpath upwards for a device with matching sysfs
       attribute values. If multiple ATTRS matches are specified,all of
       them must match on the same device. Trailing whitespace in the
       attribute values is ignored,if the specified match value does not
       contain trailing whitespace itself.

ATTR {}仅查看正在添加的节点. ATTRS {}搜索树.您的UPS可能需要ATTRS {},因为您需要的sysfs属性不在您指定的节点上.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读