Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 427996 - sys-apps/openrc: netmount needs to have dependencies on rpc.idmapd if any file systems are nfs4
Summary: sys-apps/openrc: netmount needs to have dependencies on rpc.idmapd if any fil...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
: 446690 (view as bug list)
Depends on:
Blocks: 417391
  Show dependency tree
 
Reported: 2012-07-25 08:32 UTC by Dennis Schridde
Modified: 2015-10-13 03:08 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
0001-netmount-do-not-handle-NFS-mounts.patch (0001-netmount-do-not-handle-NFS-mounts.patch,3.29 KB, patch)
2012-09-14 19:37 UTC, William Hubbs
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Schridde 2012-07-25 08:32:23 UTC
If the filesystem that the root or netmount init script (re)mounts is nfs4, it will have to depend on rpc.idmapd. I assume the test could look similar to need_portmap() in netmount. root is lacking such dependencies entirely…

Reproducible: Always
Comment 1 William Hubbs gentoo-dev 2012-08-24 15:40:18 UTC
How can I know if a filesystem is nfs4? Is this a type that will appear
in fstab?
Comment 2 Dennis Schridde 2012-08-24 18:56:10 UTC
(In reply to comment #1)
> How can I know if a filesystem is nfs4? Is this a type that will appear
> in fstab?
Yes, NFSv3 is type=nfs (or fs=server:/path leading to automatic type detection) and NFSv3 is type=nfs4.
Comment 3 Dennis Schridde 2012-08-24 19:00:44 UTC
Also, looking at need_portmap() in /etc/init.d/netmount, you might be able to use fstabinfo --fstype nfs4. A quick test on my machine shows that it outputs the mountpoints of nfs4 mounts in fstab.
Comment 4 William Hubbs gentoo-dev 2012-09-10 17:54:19 UTC
*** Bug 427998 has been marked as a duplicate of this bug. ***
Comment 5 SpanKY gentoo-dev 2012-09-12 00:42:16 UTC
depending on just rpc.idmapd is not sufficient.  nfsmount already handles the edge cases.
Comment 6 William Hubbs gentoo-dev 2012-09-12 01:27:45 UTC
@vapier:
I think the change I made here takes care of this.  3863c11

Correct?
Comment 7 SpanKY gentoo-dev 2012-09-12 01:35:15 UTC
(In reply to comment #6)

it does not.  check out the depend() in nfsmount.
Comment 8 Dennis Schridde 2012-09-12 10:23:41 UTC
If nfsmount exists, why is there duplicate functionality in netmount? Can you not just replace need_portmap() with need_nfsmount() and be done with it?
Comment 9 William Hubbs gentoo-dev 2012-09-13 00:10:21 UTC
@vapier:
Why does netmounts duplicate the functionality of nfsmounts for NFS*
file systems? Would it be a good idea to re-code netmounts to skip nfs
mounts and allow nfsmounts to take care of them?
Comment 10 William Hubbs gentoo-dev 2012-09-14 19:37:03 UTC
Created attachment 323800 [details, diff]
0001-netmount-do-not-handle-NFS-mounts.patch

@vapier and all:
This patch removes NFS handling from netmounts. I think this will be the
best way to go for OpenRC, because no other network file system we
support directly requires daemons on the client side.

What are your thoughts, both about the patch and about the way I want to
take OpenRc?
Comment 11 Dennis Schridde 2012-09-14 19:59:01 UTC
(In reply to comment #10)
> Created attachment 323800 [details, diff] [details, diff]
> 0001-netmount-do-not-handle-NFS-mounts.patch
> 
> @vapier and all:
> This patch removes NFS handling from netmounts. I think this will be the
> best way to go for OpenRC, because no other network file system we
> support directly requires daemons on the client side.
> 
> What are your thoughts, both about the patch and about the way I want to
> take OpenRc?
Patch appears good to me. Just please make sure netmount never tries to mount nfs/nfs4, because that might silently work and produce wrong results, if the daemons are not running.

Other ways to handle this would be:
* Issue a warning if fstype=nfs* and nfsmount is not running. Requires use=nfsmount and a call to service_started nfsmount.
* Figure out whether there are nfs* filesystems to be mounted and set need=nfsmount in that case. Just like need_portmap() does.
Comment 12 Dennis Schridde 2012-09-14 20:02:51 UTC
(In reply to comment #11)
> Just please make sure netmount never tries to
> mount nfs/nfs4, because that might silently work and produce wrong results,
> if the daemons are not running.
I.e. add a comment to the "continue", mentioning that this is handled by nfsmount, so that no one later removes it again.
Comment 13 William Hubbs gentoo-dev 2012-09-14 20:27:38 UTC
(In reply to comment #11)
> (In reply to comment #10)
> > Created attachment 323800 [details, diff] [details, diff] [details, diff]
> > 0001-netmount-do-not-handle-NFS-mounts.patch
> > 
> > @vapier and all:
> > This patch removes NFS handling from netmounts. I think this will be the
> > best way to go for OpenRC, because no other network file system we
> > support directly requires daemons on the client side.
> > 
> > What are your thoughts, both about the patch and about the way I want to
> > take OpenRc?
> Patch appears good to me. Just please make sure netmount never tries to
> mount nfs/nfs4, because that might silently work and produce wrong results,
> if the daemons are not running.

This patch does that; notice that in the case statements it uses continue to skip the rest of the loop for nfs|nfs4 types.

> Other ways to handle this would be:
> * Issue a warning if fstype=nfs* and nfsmount is not running. Requires
> use=nfsmount and a call to service_started nfsmount.
> * Figure out whether there are nfs* filesystems to be mounted and set
> need=nfsmount in that case. Just like need_portmap() does.

(In reply to comment #12)
> (In reply to comment #11)
> > Just please make sure netmount never tries to
> > mount nfs/nfs4, because that might silently work and produce wrong results,
> > if the daemons are not running.
> I.e. add a comment to the "continue", mentioning that this is handled by
> nfsmount, so that no one later removes it again.

The problem with all of this is that it directly refers to a service that is not part of OpenRc, so if the nfs-utils folks decide to change the name of their service, I have to do another release just because of that.
Comment 14 Dennis Schridde 2012-09-14 21:28:22 UTC
(In reply to comment #13)
> (In reply to comment #11)
> > (In reply to comment #10)
> > > Created attachment 323800 [details, diff] [details, diff] [details, diff] [details, diff]
> > > 0001-netmount-do-not-handle-NFS-mounts.patch
> > > 
> > > @vapier and all:
> > > This patch removes NFS handling from netmounts. I think this will be the
> > > best way to go for OpenRC, because no other network file system we
> > > support directly requires daemons on the client side.
> > > 
> > > What are your thoughts, both about the patch and about the way I want to
> > > take OpenRc?
> > Patch appears good to me. Just please make sure netmount never tries to
> > mount nfs/nfs4, because that might silently work and produce wrong results,
> > if the daemons are not running.
> 
> This patch does that; notice that in the case statements it uses continue to
> skip the rest of the loop for nfs|nfs4 types.
s.b.

> > Other ways to handle this would be:
> > * Issue a warning if fstype=nfs* and nfsmount is not running. Requires
> > use=nfsmount and a call to service_started nfsmount.
> > * Figure out whether there are nfs* filesystems to be mounted and set
> > need=nfsmount in that case. Just like need_portmap() does.
> 
> (In reply to comment #12)
> > (In reply to comment #11)
> > > Just please make sure netmount never tries to
> > > mount nfs/nfs4, because that might silently work and produce wrong results,
> > > if the daemons are not running.
> > I.e. add a comment to the "continue", mentioning that this is handled by
> > nfsmount, so that no one later removes it again.
> 
> The problem with all of this is that it directly refers to a service that is
> not part of OpenRc, so if the nfs-utils folks decide to change the name of
> their service, I have to do another release just because of that.

The request there was to add *a comment*, so that *developers of OpenRC* do not remove the continue line, because they think it is unnecessary (or whatever), breaking nfs mounts in the process.
Comment 15 William Hubbs gentoo-dev 2012-09-15 21:34:25 UTC
This has been implemented along with a comment explaining that netmount
does not support nfs file systems in commit a0fe1c5.
Comment 16 Dennis Schridde 2012-09-16 00:47:24 UTC
(In reply to comment #15)
> This has been implemented along with a comment explaining that netmount
> does not support nfs file systems in commit a0fe1c5.
Thanks!
Comment 17 Jeroen Roovers gentoo-dev 2012-12-10 11:40:28 UTC
*** Bug 446690 has been marked as a duplicate of this bug. ***