summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2013-09-16 09:47:09 (GMT)
committerPeter Rajnoha <prajnoha@redhat.com>2013-09-16 09:47:09 (GMT)
commit9742c5192e8871ebde12856170dae70ee861ef40 (patch)
tree93f22733435b0ebe07bc9f52bedcded25e7809a2
parentfbb732bd8eb5308eeb1dc7cc6d747552844018ac (diff)
downloadlvm2-9742c5192e8871ebde12856170dae70ee861ef40.zip
lvm2-9742c5192e8871ebde12856170dae70ee861ef40.tar.gz
lvm2-9742c5192e8871ebde12856170dae70ee861ef40.tar.xz
systemd: run lvm2-activation-net.service after lvm2-activation.service
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
-rw-r--r--WHATS_NEW1
-rw-r--r--scripts/lvm2_activation_generator_systemd_red_hat.c10
2 files changed, 6 insertions, 5 deletions
diff --git a/WHATS_NEW b/WHATS_NEW
index a46b0b4..1c4925b 100644
--- 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.
diff --git a/scripts/lvm2_activation_generator_systemd_red_hat.c b/scripts/lvm2_activation_generator_systemd_red_hat.c
index 7e93d7d..f2e2e49 100644
--- a/scripts/lvm2_activation_generator_systemd_red_hat.c
+++ b/scripts/lvm2_activation_generator_systemd_red_hat.c
@@ -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"