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