Closed zzhou1 closed 1 year ago
Can one of the admins verify this patch?
@lge
The added / might cause issues if there are anyone not using full path in their ExecStart=.
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 "." ;)
You can remove the .
. It already does .*, which covers it.
Though remove it is fine, I'm thinking to leave that "." to reinforce at least one character to filter out the empty one.
You should use .+
for that (you might have to use .\+
).
ok to test
Thanks.
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.