HomeClusterLabs Projects

nfsserver: fix "server scope" functionality to live with additional drop-in…

Description

nfsserver: fix "server scope" functionality to live with additional drop-in files

Symptom:

The distro may have additional drop-in files to override ExecStart=,
eg. openSUSE. In that case, the result drop-in file is messed up with
several ExecStart= generated. For example,

cat
/run/systemd/system/nfs-server.service.d/51-resource-agents-unshare-uts.conf

[Service]
EnvironmentFile=/run/sysconfig/nfs-server-scope

ExecStart=
ExecStart=/usr/bin/unshare --uts /bin/sh -c 'hostname ${NFS_SERVER_SCOPE}; exec "$@"' -- /usr/sbin/rpc.nfsd
ExecStart=/usr/bin/unshare --uts /bin/sh -c 'hostname ${NFS_SERVER_SCOPE}; exec "$@"' --
ExecStart=-/usr/bin/unshare --uts /bin/sh -c 'hostname ${NFS_SERVER_SCOPE}; exec "$@"' -- /usr/sbin/rpc.nfsd $NFSD_OPTIONS

Indeed, only the last ExecStart= is needed.

Details

Provenance
Roger Zhou <zzhou@suse.com>Authored on Feb 15 2023, 7:01 AM
Parents
rR9bcb9d544395: Merge pull request #1834 from oalbrigt/exportfs-pgsql-fixes
Branches
Unknown
Tags
Unknown