Bug 969152

Summary: Cannot enable rpc-statd.service
Product: [openSUSE] openSUSE Tumbleweed Reporter: Stratos Zolotas <strzol>
Component: BasesystemAssignee: Neil Brown <nfbrown>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: Current   
Target Milestone: ---   
Hardware: x86-64   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Stratos Zolotas 2016-03-02 15:49:53 UTC
Hello, 

I have a nfs mount with the following fstab options.

10.215.3.125:/srv/storage       /mnt/storage    nfs     rw,noauto,user 0 0

Every time I try to mount the nfs share from dolphin a dialog for root permission is presented asking to start rpc-statd.service. If I start the service before, it works as expected and the nfs share is directly accessible on select from dolphin

The problem is that even if I execute

systemctl enable rpc-statd.service

it says that it is on disable state and doesn't start on reboot. I have to started it manually and it starts without issues.

systemctl status rpc-statd.service
● rpc-statd.service - NFS status monitor for NFSv2/3 locking.
   Loaded: loaded (/usr/lib/systemd/system/rpc-statd.service; static; vendor preset: disabled)
   Active: active (running) since Τετ 2016-03-02 17:34:29 EET; 4min 22s ago
 Main PID: 20817 (rpc.statd)
    Tasks: 1 (limit: 512)
   CGroup: /system.slice/rpc-statd.service
           └─20817 /usr/sbin/rpc.statd --no-notify

Μάρ 02 17:34:29 teras systemd[1]: Starting NFS status monitor for NFSv2/3 locking....
Μάρ 02 17:34:29 teras rpc.statd[20817]: Version 1.3.3 starting
Μάρ 02 17:34:29 teras rpc.statd[20817]: Flags: TI-RPC
Μάρ 02 17:34:29 teras systemd[1]: Started NFS status monitor for NFSv2/3 locking..

Am I missing something or the service activation is buggy? Thanks.
Comment 1 Neil Brown 2016-04-21 05:59:35 UTC
Sorry for the long delay in getting to this :-(

rpc.statd is supposed to be started automatically when you mount.
However you are using a "user" mount and so the "systemctl" command to start statd gets run as you rather than root.

So we just need to get /sbin/mount.nfs to set its uid properly before calling start-statd.

The reason that "systemctl enable rpc-statd.service" doesn't do anything is that /usr/lib/systemd/system/rpc-statd.service has no [INSTALL] section, so systemctl doesn't know how to enabled.  It isn't meant to be enabled, it is meant to be started directly..

I've created a patch and it is building now.  The packages should appear in

http://download.opensuse.org/repositories/home:/neilbrown:/branches:/openSUSE:/Factory/standard

shortly.  Can you please install the nfs-client package and let me know if it fixes the problem?
Thanks.
Comment 2 Stratos Zolotas 2016-04-21 15:20:12 UTC
Perfect explanation, although from user side this was working on 42.1.

Patched package works as expected.

Thank you for the fix, I suppose it will pass soon in the Tumbleweed repo.
Comment 3 Neil Brown 2016-04-22 00:20:04 UTC
Thanks for testing.
I've sent the fix upsteeam, and into the opensuse system so it should appear in Tumbleweed eventually.

BTW the version I gave you has a security issue.  If you set environment variables before running "mount" they will be inherited by /usr/sbin/start-statd which could be convinced to do something unintended as root.
The version I have submitted does not have the problem.
So if anyone but you uses that machine, you should revert to the old version.
Comment 4 Bernhard Wiedemann 2016-04-22 01:00:32 UTC
This is an autogenerated message for OBS integration:
This bug (969152) was mentioned in
https://build.opensuse.org/request/show/391216 Factory / nfs-utils
Comment 5 Stratos Zolotas 2016-04-22 08:56:53 UTC
Thanks for the security notification. It is only me, so I will probably wait for the official update to pass, until then I'll use the patched version.

Thanks again for the fix.