Bug 845475

Summary: No systemd unit file fount for nfs-kernel-server
Product: [openSUSE] openSUSE Tumbleweed Reporter: Thomas Zimmermann <bugs>
Component: InstallationAssignee: Neil Brown <nfbrown>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P5 - None CC: fcrozat, forgotten_o5N6HWuMhD, ohering, per
Version: 13.1 Beta 1   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Thomas Zimmermann 2013-10-11 09:02:17 UTC
User-Agent:       Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Firefox/24.0

On a System with following patterns installed:
      x11
      kde4
      yast2_basis
      kde4_basis
      enhanced_base
      base
      fonts

After installing nfs-kernel-server the systemd nfsserver.service file can not be found. Which should be clear, as the nfs server should be started with fallback to the sysvinit script.

test-vm:/etc/sysconfig/network # zypper in nfs-kernel-server
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following NEW package is going to be installed:
  nfs-kernel-server 

1 new package to install.
Overall download size: 112.0 KiB. After the operation, additional 429.7 KiB will be used.
Continue? [y/n/?] (y): 
Retrieving package nfs-kernel-server-1.2.8-4.1.2.i586                                                                                                                                                                                     (1/1), 112.0 KiB (429.7 KiB unpacked)
Retrieving: nfs-kernel-server-1.2.8-4.1.2.i586.rpm ........................................................................................................................................................................................................[done (312.7 KiB/s)]
(1/1) Installing: nfs-kernel-server-1.2.8-4.1.2 .........................................................................................................................................................................................................................[done]
test-vm:/etc/sysconfig/network # systemctl start nfsserver.service
Failed to issue method call: Unit nfsserver.service failed to load: No such file or directory. See system logs and 'systemctl status nfsserver.service' for details.
test-vm:/etc/sysconfig/network # systemctl status nfsserver.service
nfsserver.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)
test-vm:/etc/sysconfig/network # /etc/init.d/nfsserver status
Checking for kernel based NFS server: idmapd                                                                                                                                                                                                                        unused
 mountd                                                                                                                                                                                                                                                             unused
 statd                                                                                                                                                                                                                                                              unused
 nfsd                                                                                                                                                                                                                                                               unused
nfsserver.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

test-vm:/etc/sysconfig/network # /etc/init.d/nfsserver start
redirecting to systemctl start nfsserver
Failed to issue method call: Unit nfsserver.service failed to load: No such file or directory. See system logs and 'systemctl status nfsserver.service' for details.


Reproducible: Always

Steps to Reproduce:
1. Install nfs-kernel-server
2. Start nfsserver with rcnfsserver start, /etc/init.d/nfsserver start or systemctl start nfsserver.service

Actual Results:  
/etc/init.d/nfsserver start
redirecting to systemctl start nfsserver
Failed to issue method call: Unit nfsserver.service failed to load: No such file or directory. See system logs and 'systemctl status nfsserver.service' for details.

Expected Results:  
The NFS server should start

The installation was done from the openSUSE_13.1 online repository 11. Oct 2013 08:00 UTC
Comment 1 Per Jessen 2013-10-31 08:45:00 UTC
The problem is that rpcbind isn't started.  rpcbind has a systemd service unit, whereas nfsserver does not. (it is /etc/init.d/nfsserver).
Comment 2 Neil Brown 2013-11-05 04:25:30 UTC
Maybe we need to call
  systemctl enable nfsserver

after installing nfs-kernel-server.  And  maybe 
   systemctl enable rpcbind

too.

I would have hoped that "%fillup_and_inserv" would do that.  Certainly I'd like a macro to do it rather than open-coding something in the spec file.

Frederick:  I think we might have been here before... Is there any standard approach for enabling services from rpm spec files?
Comment 3 Frederic Crozat 2013-11-05 11:00:46 UTC
(In reply to comment #2)

> Frederick:  I think we might have been here before... Is there any standard
> approach for enabling services from rpm spec files?

you mean, like this: 
http://en.opensuse.org/openSUSE:Systemd_packaging_guidelines ?
Comment 4 Neil Brown 2013-11-05 22:54:20 UTC
Yes!  Excellent, thanks.

So I can fix up nfs-utils easily - tested and works.  Just add the various %servce-{add,del}-{pre,post}{,un} lines.

rpcbind I think needs to be enabled  in systemd-presets-branding-openSUSE.
Comment 5 Neil Brown 2013-11-06 01:20:20 UTC
I'm nearly there.

Putting "enable rpcbind" in /usr/lib/systemd/system-preset/90-default-openSUSE.preset means that "rpcbind" is running after the next reboot, and with the %service-* changes to nfs-utils, 
  systemctl start nfsserver
works.

The need for a reboot seems unfortunate.  It may not be a real problem as rpcbind is part of the default install and we also reboot after that finishes.  But the need seems wrong.

Frederic: do you know if there is any way to get systemd to start any services that it would start on a reboot?  "systemctl daemon-reexec" doesn't seem to help.

If not, I'll probably just put up with the need for reboot.

b.t.w, is  there a good reason that I cannot just create a 
  /usr/lib/systemd/system-reset/80-rpcbind.preset

file in the 'rpcbind' package, rather than modifying systemd-presets-branding-openSUSE ??
Comment 6 Neil Brown 2013-11-11 06:16:52 UTC
*** Bug 833099 has been marked as a duplicate of this bug. ***
Comment 7 Bernhard Wiedemann 2013-11-18 00:00:31 UTC
This is an autogenerated message for OBS integration:
This bug (845475) was mentioned in
https://build.opensuse.org/request/show/207407 13.1 / nfs-utils
Comment 8 Swamp Workflow Management 2013-11-25 11:06:56 UTC
openSUSE-RU-2013:1769-1: An update that has 5 recommended fixes can now be installed.

Category: recommended (low)
Bug References: 833543,845269,845475,846064,849476
CVE References: 
Sources used:
openSUSE 13.1 (src):    nfs-utils-1.2.8-4.5.1
Comment 9 Forgotten User o5N6HWuMhD 2013-12-10 20:41:56 UTC
Was that "update that has 5 recommended fixes can now be installed" intended to provide the native systemd units? or simply a functional fallback to legacy sysvinit?

With most recent updates, on 13.1 I've only the fallback

systemctl status nfsserver.service
nfsserver.service - LSB: Start the kernel based NFS daemon
   Loaded: loaded (/etc/init.d/nfsserver)
   Active: active (running) since Thu 2013-12-05 22:46:45 PST; 4 days ago
   CGroup: /system.slice/nfsserver.service
           ├─3103 /usr/sbin/rpc.idmapd -p /var/lib/nfs/rpc_pipefs
           ├─3385 /usr/sbin/rpc.mountd -p 4002
           └─3485 /usr/sbin/rpc.statd --no-notify -p 4000
Comment 10 Neil Brown 2013-12-10 23:37:37 UTC
https://build.opensuse.org/package/view_file/openSUSE:13.1:Update/nfs-utils/nfs-utils.changes?expand=1

shows the changes in that update.  Related to this bug there is 

- nfs-utils.spec: add various systemd macros to make
  sure init scripts are registered properly
  bnc#845475

which relates to comment #4.

So this is only making the sysvinit scripts works a bit more reliably.

Proper native systemd unit files are still a little way off.
Comment 11 Neil Brown 2014-02-18 02:44:50 UTC
I think this is fixed now.
Proper unit files will (Hopefully) be in 13.2 but I don't plan to back-port them to 13.1.
So closing.  If there are on-going 13.1 problems that I missed, please re-open.