查看 systemd-udev-trigger 单元文件,我们可以看到如果我们想启动 systemd-udev-trigger 服务,我们需要 /sys rw,我检查了该命令 /usr/bin/udevadm trigger --type=subsystems --action =添加; /usr/bin/udevadm 触发器 --type=devices --action=add 还需要 /sys rw
#systemctl cat systemd-udev-trigger
# /usr/lib/systemd/system/systemd-udev-trigger.service
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=udev Coldplug all Devices
Documentation=man:udev(7) man:systemd-udevd.service(8)
DefaultDependencies=no
Wants=systemd-udevd.service
After=systemd-udevd-kernel.socket systemd-udevd-control.socket systemd-hwdb-update.service
Before=sysinit.target
ConditionPathIsReadWrite=/sys
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/udevadm trigger --type=subsystems --action=add ; /usr/bin/udevadm trigger --type=devices --action=add
答案1
的要点udevadm trigger
是告诉内核发送所有存在的设备的事件。它通过写入到 来实现这一点/sys/devices/*/*/uevent
。这需要 sysfs 以读写方式挂载/sys
。