From 1cb37a3ee78a99af1c823460e741d3ed26526a70 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sun, 21 Feb 2021 01:12:26 +0100 Subject: [PATCH] plugins: update conditions for udevd and udevadm commands On systems with udevd, or systemd-udevd, we must wait for udevd to start before calling udevadm. This patch updates service and runtask stanzas to the new condition system naming and adds 'log' to the udevadm cmds. Signed-off-by: Joachim Wiberg --- plugins/hotplug.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/hotplug.c b/plugins/hotplug.c index 2385d14a..333a0346 100644 --- a/plugins/hotplug.c +++ b/plugins/hotplug.c @@ -43,19 +43,19 @@ static void setup(void *arg) path = which("/lib/systemd/systemd-udevd"); if (path) { /* Register udevd as a monitored service */ - snprintf(cmd, sizeof(cmd), "[S12345789] pid:udevd %s " + snprintf(cmd, sizeof(cmd), "[S12345789] pid:udevd name:udevd %s " "-- Device event managing daemon", path); if (service_register(SVC_TYPE_SERVICE, cmd, global_rlimit, NULL)) { _pe("Failed registering %s", path); } else { - snprintf(cmd, sizeof(cmd), ":1 [S] " + snprintf(cmd, sizeof(cmd), ":1 [S] log " "udevadm trigger -c add -t devices " - "-- Requesting device events", path); + "-- Requesting device events"); service_register(SVC_TYPE_RUN, cmd, global_rlimit, NULL); - snprintf(cmd, sizeof(cmd), ":2 [S] " + snprintf(cmd, sizeof(cmd), ":2 [S] log " "udevadm trigger -c add -t subsystems " - "-- Requesting subsystem events", path); + "-- Requesting subsystem events"); service_register(SVC_TYPE_RUN, cmd, global_rlimit, NULL); }