1 |
On Mon, Oct 27, 2014 at 7:46 PM, walt <w41ter@×××××.com> wrote: |
2 |
> On 10/27/2014 12:56 PM, Canek Peláez Valdés wrote: |
3 |
>> On Mon, Oct 27, 2014 at 1:38 PM, walt <w41ter@×××××.com> wrote: |
4 |
>>> |
5 |
>>> Last night when I powered off my machines NFS was working perfectly. Today |
6 |
>>> it's broken again for the nth time: |
7 |
>>> |
8 |
>>> #systemctl status nfs-server |
9 |
>>> ● nfs-server.service - NFS server and services |
10 |
>>> Loaded: loaded (/usr/lib64/systemd/system/nfs-server.service; enabled) |
11 |
>>> Active: failed (Result: exit-code) since Mon 2014-10-27 11:50:38 PDT; 25min ago |
12 |
>>> Process: 896 ExecStopPost=/usr/sbin/exportfs -f (code=exited, status=0/SUCCESS) |
13 |
>>> Process: 893 ExecStopPost=/usr/sbin/exportfs -au (code=exited, status=0/SUCCESS) |
14 |
>>> Process: 939 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS (code=exited, status=1/FAILURE) |
15 |
>> |
16 |
>> I think I know the answer. Some days ago you moved /etc/conf.d for |
17 |
>> NetworkManager to work, right? Where does the environment variable |
18 |
>> RPCNFSDARGS is defined? I'm willing to bet that is in a /etc/conf.d |
19 |
>> file. |
20 |
>> |
21 |
>> Could you please post here the contents of nfs-server.service, and if |
22 |
>> it exists, the files inside /etc/systemd/system/nfs-server.service.d |
23 |
>> and their contents? |
24 |
> |
25 |
> Bingo again :) Your question led me to the answer, which I think is a bug |
26 |
> in /usr/lib64/systemd/system/nfs-server.service. |
27 |
> |
28 |
> Here's why the bug showed up just this morning: way back at the beginning |
29 |
> of systemd I stole some .service files from RedHat Fedora, including one |
30 |
> named 'nfs.service'. |
31 |
|
32 |
Both RH and Gentoo have now adopted the upstream systemd units, which |
33 |
don't include "nfs.service". But RH creates an "nfs.service" alias to |
34 |
"nfs-server.service" so as not to upset RHEL sysadmin muscle memory |
35 |
and scripts. |
36 |
|
37 |
|
38 |
> Turns out the foreign RedHat file was starting rpcbind for me all those |
39 |
> months and, when I deleted it last night, rpcbind didn't get started this |
40 |
> morning by nfs-server.service from gentoo (which I think is a bug). |
41 |
|
42 |
Does rpcbind.target exist? Does rpcbind.service have a "Requires" or |
43 |
"Wants" for rpcbind.target? Is rpcbind.service enabled? |
44 |
|
45 |
|
46 |
> #cat nfs-server.service |
47 |
> [Unit] |
48 |
> Description=NFS server and services |
49 |
> Requires= network.target proc-fs-nfsd.mount rpcbind.target |
50 |
> Requires= nfs-mountd.service |
51 |
> Wants=rpc-statd.service nfs-idmapd.service rpc-gssd.service rpc-svcgssd.service |
52 |
> Wants=rpc-statd-notify.service |
53 |
> |
54 |
> After= network.target proc-fs-nfsd.mount rpcbind.target nfs-mountd.service |
55 |
> After= nfs-idmapd.service rpc-statd.service |
56 |
> After= rpc-gssd.service rpc-svcgssd.service |
57 |
> Before= rpc-statd-notify.service |
58 |
> |
59 |
> [Service] |
60 |
> EnvironmentFile=/etc/conf.d/nfs |
61 |
> |
62 |
> Type=oneshot |
63 |
> RemainAfterExit=yes |
64 |
> ExecStartPre=/usr/sbin/exportfs -r |
65 |
> ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS |
66 |
> ExecStop=/usr/sbin/rpc.nfsd 0 |
67 |
> ExecStopPost=/usr/sbin/exportfs -au |
68 |
> ExecStopPost=/usr/sbin/exportfs -f |
69 |
> |
70 |
> ExecReload=/usr/sbin/exportfs -r |
71 |
> |
72 |
> [Install] |
73 |
> WantedBy=multi-user.target |
74 |
> |
75 |
> I can see that rpcbind.target is Required, but NOT rpcbind.service. AFAICT |
76 |
> rpc.target does nothing (please explain if I'm wrong about that). |
77 |
> |
78 |
> |
79 |
> BTW, /etc/conf.d/nfs doesn't define RPCNFSDARGS because it is intended |
80 |
> for use by openrc (another bug?): |
81 |
|
82 |
I don't have access to a Gentoo box with nfs at the moment in order to |
83 |
check this but IIRC Gentoo used to use OPTS_RPC_NFSD, OPTS_RPC_MOUNTD, |
84 |
OPTS_RPC_STATD but it's now using upstream's RPCNFSDARGS, |
85 |
RPCMOUNTDARGS, STATDARGS, at least in its systemd units. Again IIRC |
86 |
the ebuild only changes the upstream "EnvironmentFile=" value and |
87 |
deep-sixes nfs-config.service. |
88 |
|
89 |
|
90 |
> #cat /etc/conf.d/nfs |
91 |
> # /etc/conf.d/nfs |
92 |
> |
93 |
> # If you wish to set the port numbers for lockd, |
94 |
> # please see /etc/sysctl.conf |
95 |
> |
96 |
> # Optional services to include in default `/etc/init.d/nfs start` |
97 |
> # For NFSv4 users, you'll want to add "rpc.idmapd" here. |
98 |
> NFS_NEEDED_SERVICES="rpc.idmapd" |
99 |
> |
100 |
> # Number of servers to be started up by default |
101 |
> OPTS_RPC_NFSD="8" |
102 |
> |
103 |
> # Options to pass to rpc.mountd |
104 |
> # ex. OPTS_RPC_MOUNTD="-p 32767" |
105 |
> OPTS_RPC_MOUNTD="" |
106 |
> |
107 |
> # Options to pass to rpc.statd |
108 |
> # ex. OPTS_RPC_STATD="-p 32765 -o 32766" |
109 |
> OPTS_RPC_STATD="" |
110 |
> |
111 |
> # Options to pass to rpc.idmapd |
112 |
> OPTS_RPC_IDMAPD="" |
113 |
> |
114 |
> # Options to pass to rpc.gssd |
115 |
> OPTS_RPC_GSSD="" |
116 |
> |
117 |
> # Options to pass to rpc.svcgssd |
118 |
> OPTS_RPC_SVCGSSD="" |
119 |
> |
120 |
> # Options to pass to rpc.rquotad (requires sys-fs/quota) |
121 |
> OPTS_RPC_RQUOTAD="" |
122 |
> |
123 |
> # Timeout (in seconds) for exportfs |
124 |
> EXPORTFS_TIMEOUT=30 |
125 |
> |
126 |
> # Options to set in the nfsd filesystem (/proc/fs/nfsd/). |
127 |
> # Format is <option>=<value>. Multiple options are allowed. |
128 |
> #OPTS_NFSD="nfsv4leasetime=30 max_block_size=4096" |