解决systemd udev长时间运行超时的问题
·
systemd在响应udev事件时,会有一个超时时间,如果要处理的事件需要的时间较长,比如插入U盘,自动运行U盘里面的脚本,则很容易超时,导致事件未完全处理完成。通过修改systemd-udevd.service可以解决这个问题,修改如下:
diff --git a/rootfs/etc/udevd-conf b/rootfs/etc/udevd-conf
new file mode 100755
index 0000000000..889fefd894
--- /dev/null
+++ b/rootfs/etc/udevd-conf
@@ -0,0 +1 @@
+ARGS='--event-timeout=6000'
diff --git a/rootfs/usr/lib/systemd/system/systemd-udevd.service b/rootfs/usr/lib/systemd/system/systemd-udevd.service
old mode 100644
new mode 100755
index 3b6ff0e162..9b97ccee64
--- a/rootfs/usr/lib/systemd/system/systemd-udevd.service
+++ b/rootfs/usr/lib/systemd/system/systemd-udevd.service
@@ -21,9 +21,10 @@ OOMScoreAdjust=-1000
Sockets=systemd-udevd-control.socket systemd-udevd-kernel.socket
Restart=always
RestartSec=0
-ExecStart=/usr/lib/systemd/systemd-udevd
+EnvironmentFile=/etc/udevd-conf
+ExecStart=/usr/lib/systemd/systemd-udevd $ARGS
KillMode=mixed
-WatchdogSec=3min
+WatchdogSec=6min
TasksMax=infinity
MountFlags=shared
MemoryDenyWriteExecute=yes
更多推荐
所有评论(0)