diff --git a/autoactivate-lvmetad-with-generator.patch b/autoactivate-lvmetad-with-generator.patch new file mode 100644 index 0000000..0478077 --- /dev/null +++ b/autoactivate-lvmetad-with-generator.patch @@ -0,0 +1,40 @@ +From: Andrey Borzenkov +Subject: [PATCH] activate lvmetad in generator if use_lvmetad=1 + +This avoids unbootable system if user changes use_lvmetad but forgets +to enable lvmetad. + +Ref: https://bugzilla.novell.com/show_bug.cgi?id=862076 + +Signed-off-by: Andrey Borzenkov + +--- + scripts/lvm2_activation_generator_systemd_red_hat.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +Index: LVM2.2.02.98/scripts/lvm2_activation_generator_systemd_red_hat.c +=================================================================== +--- LVM2.2.02.98.orig/scripts/lvm2_activation_generator_systemd_red_hat.c ++++ LVM2.2.02.98/scripts/lvm2_activation_generator_systemd_red_hat.c +@@ -153,15 +153,15 @@ int main(int argc, char *argv[]) + r = EXIT_FAILURE; goto out; + } + ++ dir = argc > 1 ? argv[1] : DEFAULT_UNIT_DIR; ++ + /* If lvmetad used, rely on autoactivation instead of direct activation. */ + if (lvm_uses_lvmetad()) { + kmsg("LVM: Logical Volume autoactivation enabled.\n"); +- goto out; +- } +- +- dir = argc > 1 ? argv[1] : DEFAULT_UNIT_DIR; +- +- if (!generate_unit(dir, 1) || !generate_unit(dir, 0)) ++ if (dm_snprintf(unit_path, PATH_MAX, "%s/%s", "/usr/lib/systemd/system", "lvm2-lvmetad.socket") < 0 || ++ !register_unit_with_target (dir, "lvm2-lvmetad.socket", "sockets.target")) ++ r = EXIT_FAILURE; ++ } else if (!generate_unit(dir, 1) || !generate_unit(dir, 0)) + r = EXIT_FAILURE; + out: + kmsg("LVM: Activation generator %s.\n", r ? "failed" : "successfully completed"); diff --git a/lvm2.changes b/lvm2.changes index dd0eefb..ab93203 100644 --- a/lvm2.changes +++ b/lvm2.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Feb 12 15:17:05 UTC 2014 - arvidjaar@gmail.com + +- add autoactivate-lvmetad-with-generator.patch - if use_lvmetad=1, + automatically activate lvm2-lvmetad.socket to ensure lvmetad is + started when required (bnc#862076) + ------------------------------------------------------------------- Wed Jan 22 14:34:41 UTC 2014 - henrik.kuhn@origenis.de diff --git a/lvm2.spec b/lvm2.spec index a4ee02b..31cc2c5 100644 --- a/lvm2.spec +++ b/lvm2.spec @@ -76,6 +76,9 @@ Patch71: make_raid1_default.diff Patch72: suppress_locking_failer_message.patch Patch73: remove-fedora-systemd.patch +# bnc#862076 +Patch74: autoactivate-lvmetad-with-generator.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-build # Not a real replacement but we drop evms Provides: evms = 2.5.5 @@ -114,6 +117,7 @@ Volume Manager. %patch71 -p1 %patch72 -p1 %patch73 -p1 +%patch74 -p1 %build #set path so that thin_check can be found