File bug-1017034_systemd-use-local-remote-fs-pre.target-instead-of-lo.patch of Package lvm2.3893

From cb82919b0d77ebeeb7d35d39b9c8584e806433bf Mon Sep 17 00:00:00 2001
From: Peter Rajnoha <prajnoha@redhat.com>
Date: Wed, 23 Sep 2015 13:17:12 +0200
Subject: [PATCH] systemd: use {local,remote}-fs-pre.target instead of
 {local,remote}-fs.target

We want most of our units to be started before any local/remote mount
points are mounted - we used {local,remote}-fs.target for this purpose
before, but it was not 100% correct as there's even {local,remote}-fs-pre.target
special systemd unit reserved for this exact purpose.

See also man 7 systemd.special and "local-fs-pre.target"/"remote-fs-pre.target"
description.
---
 WHATS_NEW                                           | 1 +
 WHATS_NEW_DM                                        | 1 +
 man/lvm2-activation-generator.8.in                  | 4 ++--
 scripts/dm_event_systemd_red_hat.service.in         | 2 +-
 scripts/lvm2_activation_generator_systemd_red_hat.c | 8 ++++----
 scripts/lvm2_clvmd_systemd_red_hat.service.in       | 2 +-
 scripts/lvm2_cmirrord_systemd_red_hat.service.in    | 2 +-
 scripts/lvm2_monitoring_systemd_red_hat.service.in  | 2 +-
 8 files changed, 12 insertions(+), 10 deletions(-)

Index: LVM2.2.02.120/man/lvm2-activation-generator.8.in
===================================================================
--- LVM2.2.02.120.orig/man/lvm2-activation-generator.8.in
+++ LVM2.2.02.120/man/lvm2-activation-generator.8.in
@@ -28,8 +28,8 @@ layered on top of encrypted devices.
 
 \fIlvm2-activation-net.service\fP
 used for activation of LVM2 volumes that is ordered after systemd's
-special \fBremote-fs.target\fP to support LVM2 volumes which are layered
-on attached remote devices.
+special \fBremote-fs-pre.target\fP to support LVM2 volumes which are
+layered on attached remote devices.
 
 Note that all the underlying devices (Physical Volumes) need to be present
 when the service is run. If the there are any devices presented in the system
Index: LVM2.2.02.120/scripts/dm_event_systemd_red_hat.service.in
===================================================================
--- LVM2.2.02.120.orig/scripts/dm_event_systemd_red_hat.service.in
+++ LVM2.2.02.120/scripts/dm_event_systemd_red_hat.service.in
@@ -3,7 +3,7 @@ Description=Device-mapper event daemon
 Documentation=man:dmeventd(8)
 Requires=dm-event.socket
 After=dm-event.socket
-Before=local-fs.target
+Before=local-fs-pre.target
 DefaultDependencies=no
 
 [Service]
Index: LVM2.2.02.120/scripts/lvm2_activation_generator_systemd_red_hat.c
===================================================================
--- LVM2.2.02.120.orig/scripts/lvm2_activation_generator_systemd_red_hat.c
+++ LVM2.2.02.120/scripts/lvm2_activation_generator_systemd_red_hat.c
@@ -27,8 +27,8 @@
 #define KMSG_DEV_PATH        "/dev/kmsg"
 #define LVM_CONF_USE_LVMETAD "global/use_lvmetad"
 
-#define UNIT_TARGET_LOCAL_FS  "local-fs.target"
-#define UNIT_TARGET_REMOTE_FS "remote-fs.target"
+#define UNIT_TARGET_LOCAL_FS  "local-fs-pre.target"
+#define UNIT_TARGET_REMOTE_FS "remote-fs-pre.target"
 
 static char unit_path[PATH_MAX];
 static char target_path[PATH_MAX];
@@ -135,7 +135,7 @@ static int generate_unit(const char *dir
 
 	if (unit == UNIT_NET) {
 		fprintf(f, "After=%s iscsi.service fcoe.service\n"
-			"Before=remote-fs.target shutdown.target\n\n"
+			"Before=remote-fs-pre.target shutdown.target\n\n"
 			"[Service]\n"
 			"ExecStartPre=/usr/bin/udevadm settle\n", unit_names[UNIT_MAIN]);
 	} else {
@@ -145,7 +145,7 @@ static int generate_unit(const char *dir
 		} else
 			fprintf(f, "After= %s cryptsetup.target\n", unit_names[UNIT_EARLY]);
 
-		fputs("Before=local-fs.target shutdown.target\n"
+		fputs("Before=local-fs-pre.target shutdown.target\n"
 		      "Wants=systemd-udev-settle.service\n\n"
 		      "[Service]\n", f);
 	}
Index: LVM2.2.02.120/scripts/lvm2_clvmd_systemd_red_hat.service.in
===================================================================
--- LVM2.2.02.120.orig/scripts/lvm2_clvmd_systemd_red_hat.service.in
+++ LVM2.2.02.120/scripts/lvm2_clvmd_systemd_red_hat.service.in
@@ -2,7 +2,7 @@
 Description=Clustered LVM daemon
 Documentation=man:clvmd(8)
 After=dlm.service corosync.service
-Before=remote-fs.target
+Before=remote-fs-pre.target
 Requires=network.target dlm.service corosync.service
 RefuseManualStart=true
 RefuseManualStop=true
Index: LVM2.2.02.120/scripts/lvm2_cmirrord_systemd_red_hat.service.in
===================================================================
--- LVM2.2.02.120.orig/scripts/lvm2_cmirrord_systemd_red_hat.service.in
+++ LVM2.2.02.120/scripts/lvm2_cmirrord_systemd_red_hat.service.in
@@ -3,7 +3,7 @@ Description=Clustered LVM mirror log dae
 Documentation=man:cmirrord(8)
 Requires=corosync.service
 After=corosync.service
-Before=remote-fs.target
+Before=remote-fs-pre.target
 DefaultDependencies=no
 Conflicts=shutdown.target
 
Index: LVM2.2.02.120/scripts/lvm2_monitoring_systemd_red_hat.service.in
===================================================================
--- LVM2.2.02.120.orig/scripts/lvm2_monitoring_systemd_red_hat.service.in
+++ LVM2.2.02.120/scripts/lvm2_monitoring_systemd_red_hat.service.in
@@ -3,7 +3,7 @@ Description=Monitoring of LVM2 mirrors,
 Documentation=man:dmeventd(8) man:lvcreate(8) man:lvchange(8) man:vgchange(8)
 Requires=dm-event.socket lvm2-lvmetad.socket
 After=dm-event.socket dm-event.service lvm2-lvmetad.socket lvm2-activation.service lvm2-lvmetad.service
-Before=local-fs.target
+Before=local-fs-pre.target
 DefaultDependencies=no
 Conflicts=shutdown.target
 
Index: LVM2.2.02.120/WHATS_NEW
===================================================================
--- LVM2.2.02.120.orig/WHATS_NEW
+++ LVM2.2.02.120/WHATS_NEW
@@ -1,3 +1,7 @@
+News within backported patches
+==============================
+  Fix lvm2-{activation,clvmd,cmirrord,monitor} service to exec before mounting.
+
 Version 2.02.120 - 15th May 2015
 ================================
   Make various adjustments to Makefile compilation flags.
Index: LVM2.2.02.120/WHATS_NEW_DM
===================================================================
--- LVM2.2.02.120.orig/WHATS_NEW_DM
+++ LVM2.2.02.120/WHATS_NEW_DM
@@ -1,3 +1,7 @@
+News within backported patches
+==============================
+  Fix dm-event systemd service to make sure it is executed before mounting.
+
 Version 1.02.97 - 15th May 2015
 ===============================
   New dm_task_get_info(DM_1_02_97) supports internal_suspend state.
openSUSE Build Service is sponsored by