]> sourceware.org Git - lvm2.git/commitdiff
systemd: run lvm2-activation-net.service after lvm2-activation.service
authorPeter Rajnoha <prajnoha@redhat.com>
Mon, 16 Sep 2013 09:47:09 +0000 (11:47 +0200)
committerPeter Rajnoha <prajnoha@redhat.com>
Mon, 16 Sep 2013 09:47:09 +0000 (11:47 +0200)
The lvm2-activation-net.service was ordered only with respect to iscsi
and fcoe service before. In addition to that, we also need ordering
with respect to lvm2-activation.service to prevent parallel vgchange -aay
runs which may cause some problems during activation.
See also https://bugs.gentoo.org/show_bug.cgi?id=480066.

With this patch, the ordering is firmly set to:
lvm2-activation-early.service -> lvm2-activation.service -> lvm2-activation-net.service

Thanks to Alexander Tsoy for the original patch (modified a bit here):
https://www.redhat.com/archives/lvm-devel/2013-September/msg00049.html

WHATS_NEW
scripts/lvm2_activation_generator_systemd_red_hat.c

index a46b0b4e8e96d9548561dac670ce66732005ac5c..1c4925b21a9a4fe9f1570fcde538b3f0f6af2644 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.101 - 
 ===================================
+  Run lvm2-activation-net after lvm2-activation service to prevent parallel run.
   Add man page entries for lvmdump's -u and -l options.
   Fix lvm2app segfault while using lvm_list_pvs_free fn if there are no PVs.
   Improve of clvmd singlenode locking simulation.
index 7e93d7d72915ea7820f842d78839f9774bccc950..f2e2e4919099157ad37c8770871e3035c73744ec 100644 (file)
@@ -134,16 +134,16 @@ static int generate_unit(const char *dir, int unit)
              "DefaultDependencies=no\n", f);
 
        if (unit == UNIT_NET) {
-               fputs("After=iscsi.service fcoe.service\n"
-                     "Before=remote-fs.target shutdown.target\n\n"
-                     "[Service]\n"
-                     "ExecStartPre=/usr/bin/udevadm settle\n", f);
+               fprintf(f, "After=%s iscsi.service fcoe.service\n"
+                       "Before=remote-fs.target shutdown.target\n\n"
+                       "[Service]\n"
+                       "ExecStartPre=/usr/bin/udevadm settle\n", unit_names[UNIT_MAIN]);
        } else {
                if (unit == UNIT_EARLY) {
                        fputs("After=systemd-udev-settle.service\n"
                              "Before=cryptsetup.target\n", f);
                } else
-                       fputs("After=lvm2-activation-early.service cryptsetup.target\n", f);
+                       fprintf(f, "After= %s cryptsetup.target\n", unit_names[UNIT_EARLY]);
 
                fputs("Before=local-fs.target shutdown.target\n"
                      "Wants=systemd-udev-settle.service\n\n"
This page took 0.048636 seconds and 5 git commands to generate.