Univention Bugzilla – Bug 56545
Remove NFS kernel service Type=forking
Last modified: 2024-03-08 10:51:55 CET
NFS-kernel-service is a oneshot service. Reloading it does not work when RemainAfterExit=yes is set. systemctl 'reload-or-restart' 'nfs-kernel-server.service' Job for nfs-server.service canceled.
The type=oneshot definition was a workaround/fix for this init script, introduced in Bug #45101 git:33908fe74a7310e7d361a97d03962831a353ab55 > Author: Philipp Hahn <hahn@univention.de> > Date: Mon Jul 31 11:02:25 2017 +0000 Bug #45101 NFS: Start NFS server for first NFS share The SysV-init-script "exit 0"s when no NFS share is exported. This leads to systemd considering the 'nfs-kernel-server.service' to be running, while not 'nfsd' was started. Any later 'exportfs -r' will do nothing and a 'start' of the service is ignored, because for 'systemd' the service is already running. By setting 'RemainAfterExit=no' we tell systemd to consider the service unit as 'inactive' instead when no 'Type=forking' process remains after starting. 'GuessMainPID=yes' will detect 'rcp.mountd' as the main process. This is not 100% correct, as the 'nfsd' kernel threads are the real threads, but that should be okay. nfs-utils from Debian-Stretch is fixed and provides native systemd unit files. As QA I verified that: 1. the upstream systemd definition is Type=oneshot (https://salsa.debian.org/kernel-team/nfs-utils/-/blob/master/systemd/nfs-server.service#L22), 2. init script reload still works # /etc/init.d/nfs-kernel-server reload Reloading nfs-kernel-server configuration (via systemctl): nfs-kernel-server.service. 3. systemctl reload-or-restart nfs-kernel-server works 4. creating a NFS share works and the listener doesn't complain when doing the postrun 5. the shares test cases are green Don't know it that satisfies all cases. OK: changelog entry
univention-nfs (14.0.2) 867f6c0835e8 | fix(nfs): NFS-kernel-service is a oneshot service.