Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Feb 20, 2023

Conversation

zzhou1
Copy link
Contributor

@zzhou1 zzhou1 commented Feb 16, 2023

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.

@knet-ci-bot
Copy link

Can one of the admins verify this patch?

@zzhou1
Copy link
Contributor Author

zzhou1 commented Feb 16, 2023

@lge

@oalbrigt
Copy link
Contributor

The added / might cause issues if there are anyone not using full path in their ExecStart=.

@zzhou1
Copy link
Contributor Author

zzhou1 commented Feb 16, 2023

The added / might cause issues if there are anyone not using full path in their ExecStart=.

hmm, you are right. Let me change "/" prefix to "." ;)

@oalbrigt
Copy link
Contributor

You can remove the .. It already does .*, which covers it.

@zzhou1
Copy link
Contributor Author

zzhou1 commented Feb 16, 2023

Though remove it is fine, I'm thinking to leave that "." to reinforce at least one character to filter out the empty one.

@oalbrigt
Copy link
Contributor

oalbrigt commented Feb 16, 2023

You should use .+ for that (you might have to use .\+).

…rop-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.
@oalbrigt
Copy link
Contributor

ok to test

@oalbrigt oalbrigt merged commit f49caa9 into ClusterLabs:main Feb 20, 2023
@oalbrigt
Copy link
Contributor

Thanks.

@zzhou1 zzhou1 deleted the main branch March 30, 2023 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants