Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
Upstream nfs-utils has just fixed a conflict area on systemd behavior, maybe we also need to fix it on nfs-utils.el7:
By reading systemd.unit man pages, dependency opinion 'RequiresMountsFor= /path/to/mount_point' will handle mount point marked with 'noauto' as:
Mount points marked with noauto are not mounted
automatically and will be ignored for the purposes of
this option. If such a mount should be a requirement for
this unit, direct dependencies on the mount units may be
added (Requires= and After= or some other combination).
But on rhel-7, the 'noauto' mount point will be mounted automatically by starting nfs-server.service with 'RequiresMountsFor= /path/to/mount_point' set:
[root@~ /]# umount /home
[root@~ /]# cat /etc/fstab |grep noauto
/dev/mapper/rhel_-home /home xfs noauto 0 0
^^^ Set mount flag into noauto
[root@~ /]# mount -a
[root@~ /]# mountpoint /home/
/home/ is not a mountpoint
[root@~ /]# cat /lib/systemd/system/nfs-server.service |grep RequiresMountsFor
RequiresMountsFor= /home
^^^ Set 'RequiresMountsFor= /path/to/mount_point'
[root@~ /]# systemctl restart nfs-server
[root@~ /]# mountpoint /home/
/home/ is a mountpoint
^^^ Start nfs-server will mount it as requirement
[root@~ /]# mount |grep home
/dev/mapper/rhel_-home on /home type xfs (rw,relatime,seclabel,attr2,inode64,noquota)
How reproducible:
100%
Upstream patch:
commit 40346e1503c3d52b43ed3fe2bf56742ac5454553
Author: NeilBrown <neilb>
Date: Wed Feb 15 10:33:49 2017 -0500
nfs-server-generator: handle 'noauto' mounts correctly
When this code was written, the systemd documentation stated
that "RequiresMountsFor" ignored mountpoints marked as "noauto".
Unfortunately this is incorrect. Consquently a filesystem marked
as noauto that is also NFS exported will currently be mounted when
the NFS server is started. This is not what people expect.
So add a check for the noauto flag. If any ancestor of a given
export point has the noauto flag, no RequiresMountsFor will be
generated for that point.
Also skip RequiresMountsFor for exports marked 'mountpoint', as their
absence is, theoretically, already handled by mountd.
URL: https://github.com/systemd/systemd/issues/5249
Signed-off-by: NeilBrown <neilb>
Signed-off-by: Steve Dickson <steved>
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2017:2233
Description of problem: Upstream nfs-utils has just fixed a conflict area on systemd behavior, maybe we also need to fix it on nfs-utils.el7: By reading systemd.unit man pages, dependency opinion 'RequiresMountsFor= /path/to/mount_point' will handle mount point marked with 'noauto' as: Mount points marked with noauto are not mounted automatically and will be ignored for the purposes of this option. If such a mount should be a requirement for this unit, direct dependencies on the mount units may be added (Requires= and After= or some other combination). But on rhel-7, the 'noauto' mount point will be mounted automatically by starting nfs-server.service with 'RequiresMountsFor= /path/to/mount_point' set: [root@~ /]# umount /home [root@~ /]# cat /etc/fstab |grep noauto /dev/mapper/rhel_-home /home xfs noauto 0 0 ^^^ Set mount flag into noauto [root@~ /]# mount -a [root@~ /]# mountpoint /home/ /home/ is not a mountpoint [root@~ /]# cat /lib/systemd/system/nfs-server.service |grep RequiresMountsFor RequiresMountsFor= /home ^^^ Set 'RequiresMountsFor= /path/to/mount_point' [root@~ /]# systemctl restart nfs-server [root@~ /]# mountpoint /home/ /home/ is a mountpoint ^^^ Start nfs-server will mount it as requirement [root@~ /]# mount |grep home /dev/mapper/rhel_-home on /home type xfs (rw,relatime,seclabel,attr2,inode64,noquota) How reproducible: 100%