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
Created attachment 261534 [details, diff] test-client-fix
(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!
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. ;-)
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!
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
assuming latest version works (1.2.6)