如何重新載入udev rules?不重啟udev服務

Environment

Red Hat Enterprise Linux 8

Red Hat Enterprise Linux 7

Red Hat Enterprise Linux 6

Issue

After changing the udev rules configuration in

/etc/udev/rules。d/

, how to reload rules configuration without restarting “udev” service using

start_udev

能否使用start_udev命令?

Resolution

After making the changes in udev configuration if there is no possibility to reboot the server,

udevadm trigger

can be utilized to reload the new rules configuration in udev:

# /sbin/udevadm control ——reload-rules# /sbin/udevadm trigger ——type=devices ——action=change

Run following command for specific event:

# echo change > /sys/block//uevent

Refer

man udevadm

for more details。

More documentation is available on the system in /usr/share/doc/udev-147/writing_udev_rules/index。html。

另外能否使用start_udev命令?原廠給出明確答覆:

Nobody should ever run start_udev, only rc.sysinit should call start_udev.

NOTE:

Running a “start_udev” will cause the network hotplug action to be applied to every interface configuration file on the host which does not have HOTPLUG=no set。

This will activate any interface which does not have HOTPLUG=no set, regardless of the ONBOOT setting。

If you would like to avoid this then please ensure that each ifcfg file has HOTPLUG=no set。

使用start_udev命令可能導致網路重啟,除非網絡卡配置檔案裡面包含hotplug=no引數。