Bug 45101 - NFS server not (re)started with systemd
NFS server not (re)started with systemd
Product: UCS
Classification: Unclassified
Component: NFS
UCS 4.2
Other Linux
: P5 normal (vote)
: UCS 4.2-1-errata
Assigned To: Philipp Hahn
Jürn Brodersen
: systemd
Depends on:
Blocks: 43970
  Show dependency treegraph
Reported: 2017-07-28 17:30 CEST by Philipp Hahn
Modified: 2018-06-22 15:56 CEST (History)
0 users

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.069
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2017-07-28 17:30:10 CEST
The listener module services/univention-nfs/nfs-shares.py contains this:
202 def postrun():
203 »···initscript = '/etc/init.d/nfs-kernel-server'
204 »···listener.run(initscript, ['nfs-kernel-server', 'start'], uid=0)
205 »···listener.run(initscript, ['nfs-kernel-server', 'reload'], uid=0)

with systemd that does not work, as systemd unit nfs-kernel-server.serice is delegated to the SysV-init script /etc/init.d/nfs-kernel-server, which exists with 0 when not share is defines:
 74         if [ -f /etc/exports ] && grep -q '^[[:space:]]*[^#]*/' $export_files
 75         then
149         else
150                 log_warning_msg "Not starting $DESC: no exports."
151         fi

systemd then considers the unit as started:
>root@dc0:/# /etc/init.d/nfs-kernel-server status
>● nfs-kernel-server.service - LSB: Kernel NFS server support
>   Loaded: loaded (/etc/init.d/nfs-kernel-server)
>   Active: active (exited) since Mo 2017-06-19 16:14:31 CEST; 1 months 8 days ago
            ^^^^^^  ^^^^^^
>  Process: 25163 ExecReload=/etc/init.d/nfs-kernel-server reload (code=exited, status=0/SUCCESS)
>Jul 28 16:27:36 dc0 nfs-kernel-server[2856]: Not starting NFS kernel daemon: no exports. ... (warning).
>Jul 28 16:27:36 dc0 systemd[1]: Started LSB: Kernel NFS server support.
So line 204 does nothing and the service remains not started and the reload in line 205 goes to nirvana.

Also note that `/etc/init.d/nfs-kernel-server status` is bogus here: It returns the status of the *systemd unit*, but does *not* call the init script to check for any *nfsd* process!

CHANGES WITH systemd-229:
        * "systemctl reload-or-try-restart" has been renamed to "systemctl
          try-reload-or-restart" to clarify what it actually does: the "try"
          logic applies to both reloading and restarting, not just restarting.
          The old name continues to be accepted for compatibility.
Comment 1 Philipp Hahn univentionstaff 2017-07-31 13:10:30 CEST
r81559 | Bug #45101 NFS: Fix /etc/exports generation
r81558 | Bug #45101 NFS: Fix pickling
r81557 | Bug #45101 NFS: Merge duplicate file code
r81556 | Bug #45101 NFS: Remove useless gobal declaration
r81554 | Bug #45101 NFS: Start NFS server for first NFS share

Package: univention-nfs
Version: 9.0.0-3A~
Branch: ucs_4.2-0
Scope: errata4.2-1

r81561 | Bug #32272,Bug #33254,Bug #45101,Bug #25446 NFS. YAML
Comment 2 Jürn Brodersen univentionstaff 2017-08-01 11:48:18 CEST
There was a broken test case in 53_samba-common which checked the generated /etc/exports. I moved the test case into 49_nfs and fixed it.

r81584: move nfs test from samba section into nfs section
r81585: Fix and move nfs options test
Comment 3 Jürn Brodersen univentionstaff 2017-08-03 17:32:02 CEST
What I tested:
Added a share. -> OK
Deleted a share and readded one. -> OK
Reboot -> OK


-> Verified

Deleting the last share does not stop the nfs server any more. I don't think that is a problem.
Comment 4 Arvid Requate univentionstaff 2017-08-09 16:57:25 CEST