1 |
On Sat, Jul 26, 2014 at 9:51 AM, Alan McKinnon <alan.mckinnon@×××××.com> wrote: |
2 |
> |
3 |
> NFS uses RPC to do some heavy lifting - I don't know how familiar you |
4 |
> are with this, so here's the quick version: |
5 |
> |
6 |
> When you mount something locally, and need to use the mounted |
7 |
> filesystem, kernel calls are used to get at the data. This works easily |
8 |
> as the source disk is local and the kernel can get to it. With NFS, the |
9 |
> source disk is remote and it's the remote kernel that must do the |
10 |
> accessing. RPC is a way to safely ask a remote kernel to do something |
11 |
> and get a result that behaves identical to a local kernel call. |
12 |
> Obviously, this is rather hard to implement correctly. |
13 |
> |
14 |
> The original RPC was written by Sun and other newer implementations |
15 |
> exist, like libtirpc - to support useful features like not being stuck |
16 |
> with only UDP. That's what the "ti" means - Transport Independant. |
17 |
> |
18 |
> RPC has been in a state of flux for some time and I too have run into |
19 |
> init-script oddities as things change. |
20 |
> |
21 |
> In my case, I have nfs-utils-1.3.0, and rc-update configuredd to start |
22 |
> rpc.statd. This works because |
23 |
> |
24 |
> depend() { |
25 |
> ... |
26 |
> need portmap |
27 |
> ... |
28 |
> } |
29 |
> |
30 |
> and in the init.d file for rpcbind: |
31 |
> |
32 |
> depend() { |
33 |
> ... |
34 |
> provide portmap |
35 |
> } |
36 |
> |
37 |
> So rpcbind starts at boot time and all my nfs mounts JustWork |
38 |
|
39 |
To confirm the above, for nfs-utils-1.2.9-r3. |
40 |
|
41 |
If I start nfs manually, all the associated daemons start too even |
42 |
though I haven't added them to "default" (although idmapd is started |
43 |
because of "/etc/conf.d/nfs"): |
44 |
|
45 |
# ls -1 /etc/init.d/rpc* |
46 |
/etc/init.d/rpc.idmapd |
47 |
/etc/init.d/rpc.pipefs |
48 |
/etc/init.d/rpc.statd |
49 |
/etc/init.d/rpcbind |
50 |
|
51 |
# rc-update | grep rpc |
52 |
|
53 |
# rc-service nfs start |
54 |
* Starting rpcbind ... [ ok ] |
55 |
* Starting NFS statd ... [ ok ] |
56 |
* Setting up RPC pipefs ... [ ok ] |
57 |
* Starting idmapd ... [ ok ] |
58 |
* Mounting nfsd filesystem in /proc ... [ ok ] |
59 |
* Exporting NFS directories ... [ ok ] |
60 |
* Starting NFS mountd ... [ ok ] |
61 |
* Starting NFS daemon ... [ ok ] |
62 |
* Starting NFS smnotify ... [ ok ] |
63 |
|
64 |
# |