anitazha / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone
1abbee
From 9592604df60795ad8b58aa11311a26f267385bae Mon Sep 17 00:00:00 2001
1abbee
From: Karel Zak <kzak@redhat.com>
1abbee
Date: Tue, 28 Jul 2015 11:31:45 +0200
1abbee
Subject: [PATCH] mount: remove obsolete -n
1abbee
1abbee
It seems that systemd still uses legacy -n option. The option has been
1abbee
originally designed to avoid write to /etc/mtab during boot when root
1abbee
FS is not ready or read-only.
1abbee
1abbee
This is not necessary for long time, because /etc/mtab is not a real
1abbee
file (it's symlink) and write to the file is impossible. All utils
1abbee
should be able to detect the symlink and ignore mtab. This concept is
1abbee
supported for very long time before systemd.
1abbee
1abbee
The userspase mount options are currently maintained by libmount
1abbee
(mount(8) and mount.nfs) in /run/mount) which is tmpfs initialized
1abbee
during early boot.
1abbee
1abbee
(cherry picked from commit 6f20f850f79df365c2533195214127142013d317)
1abbee
Resolves: #1339721
1abbee
---
1abbee
 src/core/mount.c | 6 ------
1abbee
 1 file changed, 6 deletions(-)
1abbee
1abbee
diff --git a/src/core/mount.c b/src/core/mount.c
181b3f
index 23f63ce32..fe967bc03 100644
1abbee
--- a/src/core/mount.c
1abbee
+++ b/src/core/mount.c
1abbee
@@ -881,8 +881,6 @@ static void mount_enter_unmounting(Mount *m) {
1abbee
         m->control_command = m->exec_command + MOUNT_EXEC_UNMOUNT;
1abbee
 
1abbee
         r = exec_command_set(m->control_command, "/bin/umount", m->where, NULL);
1abbee
-        if (r >= 0 && UNIT(m)->manager->running_as == SYSTEMD_SYSTEM)
1abbee
-                r = exec_command_append(m->control_command, "-n", NULL);
1abbee
         if (r < 0)
1abbee
                 goto fail;
1abbee
 
1abbee
@@ -935,8 +933,6 @@ static void mount_enter_mounting(Mount *m) {
1abbee
 
1abbee
                 r = exec_command_set(m->control_command, "/bin/mount",
1abbee
                                      m->parameters_fragment.what, m->where, NULL);
1abbee
-                if (r >= 0 && UNIT(m)->manager->running_as == SYSTEMD_SYSTEM)
1abbee
-                        r = exec_command_append(m->control_command, "-n", NULL);
1abbee
                 if (r >= 0 && m->sloppy_options)
1abbee
                         r = exec_command_append(m->control_command, "-s", NULL);
1abbee
                 if (r >= 0 && m->parameters_fragment.fstype)
1abbee
@@ -985,8 +981,6 @@ static void mount_enter_remounting(Mount *m) {
1abbee
                 r = exec_command_set(m->control_command, "/bin/mount",
1abbee
                                      m->parameters_fragment.what, m->where,
1abbee
                                      "-o", o, NULL);
1abbee
-                if (r >= 0 && UNIT(m)->manager->running_as == SYSTEMD_SYSTEM)
1abbee
-                        r = exec_command_append(m->control_command, "-n", NULL);
1abbee
                 if (r >= 0 && m->sloppy_options)
1abbee
                         r = exec_command_append(m->control_command, "-s", NULL);
1abbee
                 if (r >= 0 && m->parameters_fragment.fstype)