Bug 56545 - Remove NFS kernel service Type=forking
Remove NFS kernel service Type=forking
Status: VERIFIED FIXED
Product: UCS
Classification: Unclassified
Component: NFS
UCS 5.2
Other Linux
: P5 normal (vote)
: UCS 5.2
Assigned To: Julia Bremer
Florian Best
:
Depends on: 45101
Blocks:
  Show dependency treegraph
 
Reported: 2023-09-05 20:52 CEST by Florian Best
Modified: 2024-03-08 10:51 CET (History)
0 users

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
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:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2023-09-05 20:52:25 CEST
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.
Comment 2 Florian Best univentionstaff 2023-11-02 15:56:10 CET
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
Comment 3 Florian Best univentionstaff 2024-03-08 10:51:55 CET
univention-nfs (14.0.2)
867f6c0835e8 | fix(nfs): NFS-kernel-service is a oneshot service.