Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 529280 - net-fs/nfs-utils with >=openrc-0.13.x no longer needs nfsmount init script
Summary: net-fs/nfs-utils with >=openrc-0.13.x no longer needs nfsmount init script
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Network Filesystems
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 530418
  Show dependency tree
 
Reported: 2014-11-14 22:54 UTC by William Hubbs
Modified: 2024-03-01 15:17 UTC (History)
3 users (show)

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


Attachments
nfs-utils-1.3.0.patch (nfs-utils-1.3.0.patch,1.43 KB, patch)
2014-11-15 20:01 UTC, William Hubbs
Details | Diff
nfsclient.initd (nfsclient.initd,1023 bytes, text/plain)
2014-11-15 20:02 UTC, William Hubbs
Details
nfsclient.initd.patch (nfsclient.initd.patch,1.17 KB, patch)
2014-12-08 17:46 UTC, William Hubbs
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description William Hubbs gentoo-dev 2014-11-14 22:54:29 UTC
I have spoken with radhermit about this, but I'm also opening this bug
so we can track it here.

When fixing bug #427996, I made a change that  should not have been
made. netmount was skipping mounting and unmounting nfs file systems.
This was fixed in bug #508574. The complete fix is included in
OpenRC-0.13.4.

This means that the following should happen in nfs-utils.

1. /etc/init.d/nfsmount is no longer necessary with this version of
OpenRC.

2. All of the init scripts in nfs-utils should have "before netmount"
added to their depend function.

Radhermit has given me permission to make this happen, but  I don't want
to touch the init scripts directly without approval since there is no
way for me to test, (I don't use nfs), so I'll attach a patch here for
review.
Comment 1 Rick Farina (Zero_Chaos) gentoo-dev 2014-11-15 01:11:05 UTC
the current nfs-utils init script isn't very current, however, it has some great things for calculating deps of the init script automatically based on what is in fstab.  this should be ported to netmount so it can start the needed services automatically.
Comment 2 William Hubbs gentoo-dev 2014-11-15 02:50:06 UTC
(In reply to Rick Farina (Zero_Chaos) from comment #1)
> the current nfs-utils init script isn't very current, however, it has some
> great things for calculating deps of the init script automatically based on
> what is in fstab.  this should be ported to netmount so it can start the
> needed services automatically.


Or we could make nfsmount not mount anything and just 
run before netmount.

I'll definitely talk to the herd members before I do anything with this.
Comment 3 William Hubbs gentoo-dev 2014-11-15 19:57:19 UTC
My proposal for this is to modify nfsmount.initd so that it doesn't
really mount anything; it would just make sure the nfs client services
are started. I also propose renaming the script to nfsclient.initd,
because nfsclient is a better description of what it does, and because
renaming it means we don't interfeer with older versions of nfs-utils in
the tree when we do the revbump.

I don't know if any services have a dependency on nfsmount, so I will
make nfsclient provide it just to be sure.

I will not post nfsclient.confd because it is identical to
nfsmount.confd, but I will post nfsclient.initd and the patch which
shows the differences between nfs-utils-1.3.0-r1 and nfs-utils-1.3.0-r2.

Please test and let me know how this works.
Comment 4 William Hubbs gentoo-dev 2014-11-15 20:01:05 UTC
Created attachment 389442 [details, diff]
nfs-utils-1.3.0.patch

This is the differences between nfs-utils-1.3.0-r1 and
nfs-utils-1.3.0-r2.
Comment 5 William Hubbs gentoo-dev 2014-11-15 20:02:59 UTC
Created attachment 389444 [details]
nfsclient.initd

This is the nfsclient service script.

As I said above, I will not attach nfsclient.confd, because it is
identical to nfsmount.confd.
Comment 6 Rick Farina (Zero_Chaos) gentoo-dev 2014-11-15 20:31:11 UTC
So instead of needing just nfsmount script to mount my nfs shares, now I need netmount AND nfsclient in default runlevel? How does this help me at all?  Why not just build this into the netmount script?

My objection to this is the same as always, you are not making things easier, you are making them harder.
Comment 7 William Hubbs gentoo-dev 2014-11-15 22:43:21 UTC
We had a discussion about this on IRC, but I am going to respond here so that the others on the team will see my response.

(In reply to Rick Farina (Zero_Chaos) from comment #6)
> So instead of needing just nfsmount script to mount my nfs shares, now I
> need netmount AND nfsclient in default runlevel? How does this help me at
> all?  Why not just build this into the netmount script?

Netmount should not start the nfs client services. This is the way all of the network file systems we have work as far as I know. netmount tries to mount them, but is not responsible for starting their services.

The problem with netmount running the nfs client services is that I have no way to know how other distros configure them, so there is no way for me to set up the dependencies.

This bug offers the way for Gentoo to be sure the nfs client services are started before netmount runs and tries to mount the nfs file systems.
Comment 8 Rick Farina (Zero_Chaos) gentoo-dev 2014-11-18 02:58:54 UTC
(In reply to William Hubbs from comment #7)
> We had a discussion about this on IRC, but I am going to respond here so
> that the others on the team will see my response.
> 
> (In reply to Rick Farina (Zero_Chaos) from comment #6)
> > So instead of needing just nfsmount script to mount my nfs shares, now I
> > need netmount AND nfsclient in default runlevel? How does this help me at
> > all?  Why not just build this into the netmount script?
> 
> Netmount should not start the nfs client services. This is the way all of
> the network file systems we have work as far as I know. netmount tries to
> mount them, but is not responsible for starting their services.
> 
> The problem with netmount running the nfs client services is that I have no
> way to know how other distros configure them, so there is no way for me to
> set up the dependencies.
> 
> This bug offers the way for Gentoo to be sure the nfs client services are
> started before netmount runs and tries to mount the nfs file systems.

Just to be clear, my issue is that we are going from a script called "nfsmount" which actually mounts my nfs shares, to needing TWO scripts in the default runlevel just to do what one is doing now.

The reasoning for this? So we don't mess up other distros.

I don't want to sound insensitive, I'm happy other distros work with openrc.  That said, this is not a good idea.  We should be fixing this so that one init script can handle things, it shouldn't be hard to add an "if [ $distro = gentoo ]" or similar and get things right.  If other distros need to have multiple scripts to make nfs work that is fine, but why cripple function for gentoo with no gain?  Let's make this work... please?
Comment 9 Tim Harder gentoo-dev 2014-11-18 18:31:34 UTC
(In reply to Rick Farina (Zero_Chaos) from comment #8)
> Just to be clear, my issue is that we are going from a script called
> "nfsmount" which actually mounts my nfs shares, to needing TWO scripts in
> the default runlevel just to do what one is doing now.
> 
> The reasoning for this? So we don't mess up other distros.

I'm all for consistency, meaning that we should work towards having all netfs related init scripts handling their own mounting or not. In this case it seems we're moving towards one script for mounting with all the others handling the various required services for the related network filesystems.

There are upsides/downsides to either way, I assume this method was chosen to try to separate as much specific case by case netfs stuff out of netmount.

> I don't want to sound insensitive, I'm happy other distros work with openrc.
> That said, this is not a good idea.  We should be fixing this so that one
> init script can handle things, it shouldn't be hard to add an "if [ $distro
> = gentoo ]" or similar and get things right.  If other distros need to have
> multiple scripts to make nfs work that is fine, but why cripple function for
> gentoo with no gain?  Let's make this work... please?

I don't think "cripple" is a good word to use here when we're just talking about splitting up init scripts to achieve more consistency. I think we'd all be happy to hear other proposed ideas or look at other patches, but I don't think turning netmount into a singular script handling all cases is the best solution.
Comment 10 William Hubbs gentoo-dev 2014-12-08 17:46:05 UTC
Created attachment 391230 [details, diff]
nfsclient.initd.patch

This is a patch that shows the differences between nfsmount and my
proposed nfsclient script, also the ebuild patch above still applies.

I also worked out a way to fix bug #529568 which is included in this
patch.

The other advantage of this patch is it eliminates the awk call by using
OpenRC's fstabinfo to get the same information.
Comment 11 Tim Harder gentoo-dev 2014-12-22 19:24:49 UTC
Fixed in 1.3.1.
Comment 12 parafin 2014-12-24 14:01:53 UTC
Did anyone test nfsclient script? The part that detects rpc.gssd doesn't work - you can't modify a variable inside a pipe cause I guess that code runs in a subshell or smth.
Comment 13 Tim Harder gentoo-dev 2014-12-24 18:06:36 UTC
(In reply to parafin from comment #12)
> Did anyone test nfsclient script? The part that detects rpc.gssd doesn't
> work - you can't modify a variable inside a pipe cause I guess that code
> runs in a subshell or smth.

Should be fixed in 1.3.1-r1.