Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 353717

Summary: net-fs/nfs-utils-1.1.4-r1:exportfs fails to test shares and exits with 22
Product: Gentoo Linux Reporter: Jimmy Kloss <jimmy.kloss>
Component: Current packagesAssignee: Network Filesystems <net-fs>
Status: RESOLVED FIXED    
Severity: normal CC: natunobilis
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: test-client-fix
quick&dirty nfs.service

Description Jimmy Kloss 2011-02-04 20:11:41 UTC
After switching to systemd and writing a little nfs.service file I noticed that exportfs is missbehaving:

HyperBel ~ # /usr/sbin/exportfs -r
exportfs: /proc/fs/nfs/exports:1: unknown keyword "test-client-(rw"

HyperBel ~ # echo $?
22

The funny thing is that despite the warning and the exit code (what's 22 supposed to mean anyway?) it works, meaning the shares get exported and are mountable from remote hosts.

The problem is that exportfs has a test function with the hardcoded hostname "-test-client-" which is misinterpeted as an unknown keyword as it starts with a dash.

I wrote a little patch to fix that. Also I quickly checked the source of 1.2.3 and it still uses the same hostname. So probably all version suffer from this bug.

Reproducible: Always

Steps to Reproduce:
1. have your nsfd running
2. exportfs -r
3. 22
Comment 1 Jimmy Kloss 2011-02-04 20:13:11 UTC
Created attachment 261534 [details, diff]
test-client-fix
Comment 2 Pablo Hess 2011-02-15 03:30:22 UTC
(In reply to comment #0)
> After switching to systemd and writing a little nfs.service file...

Would you be kind enough to paste your nfs.service file here?
I've been struggling with systemd to start my nfs unit and the only solution I saw was to write 4 other unit files: portmap.service and rpc-{statd,nfsd,mountd}.service.

Also, I have noticed the same bug in exportfs.

Thanks!
Comment 3 Jimmy Kloss 2011-02-16 11:03:11 UTC
Created attachment 262709 [details]
quick&dirty nfs.service

I simply translated the output from /etc/init.d/nfs into a nfs.service file to fit my needs. It doesn't cover e.g. rpc.statd, which would require a separate service file as it's a separate daemon. Also it seems to automatically get started. The problem I have is that I have to call exportfs -r again after boot to get my exports done. Maybe a nfs.timer could take care of this. In the end nfs is still a mess, but try my service file if helps. ;-)
Comment 4 Pablo Hess 2011-02-16 15:22:00 UTC
Thanks a lot. Your use of ExecStart{Pre,Post} is indeed quick&dirty, but it seems to work. I'll use your ideas to change my 4 unit files a little. Thanks!
Comment 5 SpanKY gentoo-dev 2011-05-29 00:30:36 UTC
probably fixed by this upstream commit:
http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=commitdiff;h=56f537535190d034039570bafd9a0de71b79b8f1

please give it a try
Comment 6 SpanKY gentoo-dev 2013-03-24 20:22:02 UTC
assuming latest version works (1.2.6)