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