From 092951f634658ead34b32cdf345cb29ddafeef19 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 8 Apr 2024 19:44:39 +0200 Subject: [PATCH] dmeventd: check for running dmeventd for status Before initiation fifo communication, check whether there is running dmeventd - in case there is no running instance, this would be just blocked for 5 seconds trying to open fifo. --- WHATS_NEW_DM | 1 + daemons/dmeventd/dmeventd.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index d27faf183..eed728a9a 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.198 - =================== + Query with dmeventd -i quickly ends when there is no running dmeventd. Enhance dm_get_status_raid to handle mismatching status or reported legs. Create /dev/disk/by-label symlinks for DM devs that have crypto as next layer. Persist udev db for DM devs on cleanup used in initrd to rootfs transition. diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c index b52a67b6f..9d7d6f6e8 100644 --- a/daemons/dmeventd/dmeventd.c +++ b/daemons/dmeventd/dmeventd.c @@ -2080,6 +2080,11 @@ static int _info_dmeventd(const char *name, struct dm_event_fifos *fifos) int version; int ret = 0; + if (!dm_daemon_is_running(DMEVENTD_PIDFILE)) { + fprintf(stderr, "No running dmeventd instance for status query.\n"); + return 0; + } + /* Get the list of registrations from the running daemon. */ if (!init_fifos(fifos)) { fprintf(stderr, "Could not initiate communication with existing dmeventd.\n"); -- 2.43.5