[systemd/f15] Fix remote-fs-pre.target and its ordering

Michal Schmidt michich at fedoraproject.org
Tue Nov 1 23:34:53 UTC 2011


commit 0fce2c35fce67f9578cffc63899d1761635cc6f6
Author: Michal Schmidt <mschmidt at redhat.com>
Date:   Wed Nov 2 00:29:30 2011 +0100

    Fix remote-fs-pre.target and its ordering
    
    Fixes: BZ#749940

 ...-remote-mounts-after-both-network.target-.patch |   50 ++++++++++++++++++++
 ...Install-section-from-remote-fs-pre.target.patch |   26 ++++++++++
 systemd.spec                                       |    8 +++-
 3 files changed, 83 insertions(+), 1 deletions(-)
---
diff --git a/0001-mount-order-remote-mounts-after-both-network.target-.patch b/0001-mount-order-remote-mounts-after-both-network.target-.patch
new file mode 100644
index 0000000..c845c8d
--- /dev/null
+++ b/0001-mount-order-remote-mounts-after-both-network.target-.patch
@@ -0,0 +1,50 @@
+From 7fc2a89a7387db1e5daa4892393c9e9536920c25 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Tue, 1 Nov 2011 22:27:48 +0100
+Subject: [PATCH] mount: order remote mounts after both network.target and
+ remote-fs-pre.target
+
+Since remote-fs-pre.target is optional we cannot count on it to order
+remote mounts after network.target, so let's add that order explicitly
+in addition to remote-fs-pre.target.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=749940
+---
+ src/mount.c |    7 ++++++-
+ 1 files changed, 6 insertions(+), 1 deletions(-)
+
+diff --git a/src/mount.c b/src/mount.c
+index ef953f0..f9cfe91 100644
+--- a/src/mount.c
++++ b/src/mount.c
+@@ -327,7 +327,7 @@ static bool needs_quota(MountParameters *p) {
+ }
+ 
+ static int mount_add_fstab_links(Mount *m) {
+-        const char *target, *after = NULL;
++        const char *target, *after = NULL, *after2 = NULL;
+         MountParameters *p;
+         Unit *tu;
+         int r;
+@@ -358,6 +358,7 @@ static int mount_add_fstab_links(Mount *m) {
+         if (mount_is_network(p)) {
+                 target = SPECIAL_REMOTE_FS_TARGET;
+                 after = SPECIAL_REMOTE_FS_PRE_TARGET;
++                after2 = SPECIAL_NETWORK_TARGET;
+         } else {
+                 target = SPECIAL_LOCAL_FS_TARGET;
+                 after = SPECIAL_LOCAL_FS_PRE_TARGET;
+@@ -374,6 +375,10 @@ static int mount_add_fstab_links(Mount *m) {
+                 if ((r = unit_add_dependency_by_name(UNIT(m), UNIT_AFTER, after, NULL, true)) < 0)
+                         return r;
+ 
++        if (after2)
++                if ((r = unit_add_dependency_by_name(UNIT(m), UNIT_AFTER, after2, NULL, true)) < 0)
++                        return r;
++
+         if (automount) {
+                 Unit *am;
+ 
+-- 
+1.7.7
+
diff --git a/0001-units-drop-Install-section-from-remote-fs-pre.target.patch b/0001-units-drop-Install-section-from-remote-fs-pre.target.patch
new file mode 100644
index 0000000..bbad2fd
--- /dev/null
+++ b/0001-units-drop-Install-section-from-remote-fs-pre.target.patch
@@ -0,0 +1,26 @@
+From fc8f0b5c9cb8277950a2fefdb7f754c47b172dfd Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Tue, 1 Nov 2011 22:29:48 +0100
+Subject: [PATCH] units: drop [Install] section from remote-fs-pre.target
+
+remote-fs-pre.target is not a unit a user should ever explicitly enable.
+Instead services which need to hook before network mounts should pull it
+in.
+---
+ units/remote-fs-pre.target |    3 ---
+ 1 files changed, 0 insertions(+), 3 deletions(-)
+
+diff --git a/units/remote-fs-pre.target b/units/remote-fs-pre.target
+index 5406aa2..8aceb08 100644
+--- a/units/remote-fs-pre.target
++++ b/units/remote-fs-pre.target
+@@ -10,6 +10,3 @@
+ [Unit]
+ Description=Remote File Systems (Pre)
+ After=network.target
+-
+-[Install]
+-WantedBy=multi-user.target
+-- 
+1.7.7
+
diff --git a/systemd.spec b/systemd.spec
index 62b9362..f16832f 100644
--- a/systemd.spec
+++ b/systemd.spec
@@ -2,7 +2,7 @@ Name:           systemd
 Url:            http://www.freedesktop.org/wiki/Software/systemd
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Version:        26
-Release:        12%{?dist}
+Release:        13%{?dist}
 License:        GPLv2+
 Group:          System Environment/Base
 Summary:        A System and Service Manager
@@ -114,6 +114,8 @@ Patch71:        0001-units-forgot-target-units.patch
 Patch72:        0001-units-remount-root-and-API-FS-before-all-mount-units.patch
 Patch73:        0001-service-don-t-try-to-guess-PID-for-SysV-services-any.patch
 Patch74:        0002-manager-fix-a-crash-in-isolating.patch
+Patch75:        0001-mount-order-remote-mounts-after-both-network.target-.patch
+Patch76:        0001-units-drop-Install-section-from-remote-fs-pre.target.patch
 Patch100:       fedora-storage-detect-encrypted-PVs.patch
 
 # For sysvinit tools
@@ -376,6 +378,10 @@ fi
 %{_bindir}/systemd-sysv-convert
 
 %changelog
+* Wed Nov 02 2011 Michal Schmidt <mschmidt at redhat.com> - 26-13
+- Fix remote-fs-pre.target and its ordering.
+- Fixes: BZ#749940
+
 * Wed Oct 19 2011 Michal Schmidt <mschmidt at redhat.com> - 26-12
 - Fix a crash in isolating.
 - Fixes: BZ#717325


More information about the scm-commits mailing list