Gentoo Archives: gentoo-dev

From: Ian Stakenvicius <axs@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: rfc: improve file system mounting and unmounting in OpenRC
Date: Fri, 07 Aug 2015 19:30:49
Message-Id: 55C50761.2030400@gentoo.org
In Reply to: Re: [gentoo-dev] Re: rfc: improve file system mounting and unmounting in OpenRC by William Hubbs
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA256
3
4 On 07/08/15 03:18 PM, William Hubbs wrote:
5 > On Fri, Aug 07, 2015 at 01:39:25PM -0400, Ian Stakenvicius wrote:
6 >> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
7 >>
8 >> On 07/08/15 12:59 PM, William Hubbs wrote:
9 >>> On Fri, Aug 07, 2015 at 12:10:56PM -0400, Ian Stakenvicius
10 >>> wrote:
11 >>>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
12 >>>>
13 >>>> On 07/08/15 11:30 AM, William Hubbs wrote:
14 >>>>> On Thu, Aug 06, 2015 at 08:07:44PM -0400, Ian Stakenvicius
15 >>>>> wrote:
16 >>>>>>
17 >>>>>> Can we get "nofail" immediately in the mount -a variants
18 >>>>>> of localmount/netmount and expand that in netmount to
19 >>>>>> make the nfsclient dep be a "use" or a "need" depending
20 >>>>>> on if it's set or not?? That would imo kill the existing
21 >>>>>> bug that started all of this too.
22 >>>>>
23 >>>>> Sure, I can get the nofail support in pretty quick, and I
24 >>>>> think that is a feature we should have.
25 >>>>>
26 >>>>> Right now, netmount is using the use dependency to make
27 >>>>> sure network file system utilities are started before us.
28 >>>>> Because of the all-or-nothing nature of netmount, we can't
29 >>>>> switch those dependencies to need. It would cause netmount
30 >>>>> to fail if one of those utilities fails to start. The use
31 >>>>> dependency is the best one we can use at this time, and a
32 >>>>> migration path was specifically laid out in the news item.
33 >>>>>
34 >>>>
35 >>>> My thinking here is that, unless network mounts in fstab are
36 >>>> listed as 'nofail', that netmount failing due to the
37 >>>> dependent services not being able to start would be a valid
38 >>>> case. Sysadmins that don't want netmount to fail no matter
39 >>>> what would be able to use 'nofail' to ensure that happens.
40 >>>>
41 >>>> This is of course predicated on (1) it being a good idea,
42 >>>> and (2) fstabinfo or whatever the check currently is that
43 >>>> would add nfsclient to depend() could easily swap 'use' for
44 >>>> 'need' based on the (lack of) existence of the nofail
45 >>>> attribute in fstab.
46 >>>
47 >>> The issue with using the need dependency is that netmount is
48 >>> not granular enough. It mounts all types of network file
49 >>> systems, so if we fail because nfs is a need dependency and
50 >>> doesn't start, no other types of network file systems that use
51 >>> daemons will be mounted. That's what I meant by
52 >>> all-or-nothing.
53 >>>
54 >>> William
55 >>>
56 >>
57 >> Yes I follow that. My thoughts are #1, netmount (and localmount
58 >> for that matter) are all-or-nothing things; so if the service
59 >> fails then I don't think anything can necessarily be assumed as
60 >> to which mounts succeeded and which don't.
61 >
62 > Yes, they are, but mount and umount -a are not. They can report
63 > partial failures (check the exit codes).
64 >
65 > If I switch to using need dependencies for the file system clients,
66 > and one fails to start, mount -a would never run, which means NO
67 > net-based file systems that use clients would be mounted.
68
69 Yeah I follow that, I just don't see that as something we need to
70 avoid given it can be avoided on systems by keeping netmount from
71 failing via 'nofail' on nfs mounts in fstab (or there being no 'auto'
72 nfs mounts in fstab to begin with)
73
74 If the plan is that localmount and netmount will return error and fail
75 when one-or-more fstab entries with 'auto' and without 'nofail' can't
76 be mounted, then I see it as being convenient that netmount would
77 mount the other filesystems, but not imperative.
78
79 (in case i wasn't clear earlier, i am talking about the 'need' vs
80 'use' being dynamically chosen by the script; yes it's almost as evil
81 as the dynamic choices in depend() that might be necessary to do a
82 'localmount' wrapper around mount.* services, but instead of it being
83 done for -everything- it's at least only done for one or a few corner
84 cases -- that being nfs mounts but there are likely others that need
85 daemons started at runtime)
86
87
88 > My thinking is to allow things to mount that can, but still report
89 > it as a failure if everything doesn't mount.
90
91 Except for the fact that this isn't possible with a 'need' on
92 nfsclient, I think it's a great plan. :)
93
94 -----BEGIN PGP SIGNATURE-----
95 Version: GnuPG v2
96
97 iF4EAREIAAYFAlXFB2EACgkQAJxUfCtlWe1VkAEA0YhNvBeeRQRg0Bl1RWAniDvO
98 vspzbj73u+ed8pRZt6UBALIwLqsY2V1fQo/UWeyELjzQijg8TtRHCqz7iVpT4kMf
99 =e3K5
100 -----END PGP SIGNATURE-----

Replies