WHATS_NEW | 1 +
scripts/generator-internals.c | 3 ++-
scripts/lvm2_activation_generator_systemd_red_hat.c | 15 ++++++++++-----
3 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 002b5a3..4b68dbd 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.03.03 -
====================================
+ Fix generator querying config options missing from lvm.conf.
Restore missing man info lvcreate --zero for thin-pools.
Drop misleadning comment for metadata minimum_io_size for VDO segment.
Improve -lXXX%VG modifier which improves cache segment estimation.
diff --git a/scripts/generator-internals.c b/scripts/generator-internals.c
index 9619e8c..7bab4f9 100644
--- a/scripts/generator-internals.c
+++ b/scripts/generator-internals.c
@@ -170,7 +170,8 @@ static bool _parse_line(const char *line, struct config *cfg)
static bool _get_config(struct config *cfg, const char *lvmconfig_path)
{
static const char *_argv[] = {
- "lvmconfig", LVM_CONF_EVENT_ACTIVATION, LVM_CONF_USE_LVMPOLLD, NULL
+ "lvmconfig", "--type", "full",
+ LVM_CONF_EVENT_ACTIVATION, LVM_CONF_USE_LVMPOLLD, NULL
};
bool r = true;
diff --git a/scripts/lvm2_activation_generator_systemd_red_hat.c b/scripts/lvm2_activation_generator_systemd_red_hat.c
index 0e6c05a..99b5f22 100644
--- a/scripts/lvm2_activation_generator_systemd_red_hat.c
+++ b/scripts/lvm2_activation_generator_systemd_red_hat.c
@@ -213,12 +213,17 @@ static bool _run(int argc, const char **argv)
if (!_parse_command_line(&gen, argc, argv))
return false;
- if (!_get_config(&gen.cfg, LVMCONFIG_PATH))
- return false;
+ if (_get_config(&gen.cfg, LVMCONFIG_PATH)) {
+ if (gen.cfg.event_activation)
+ // If event_activation=1, pvscan --cache -aay does activation.
+ return true;
+ }
- if (gen.cfg.event_activation)
- // If event_activation=1, pvscan --cache -aay does activation.
- return true;
+ /*
+ * Create the activation units if:
+ * - _get_config succeeded and event_activation=0
+ * - _get_config failed, then this is a failsafe fallback
+ */
/* mark lvm2-activation.*.service as world-accessible */
old_mask = umask(0022);