Skip to content

Commit

Permalink
Merge pull request #1842 from zzhou1/main
Browse files Browse the repository at this point in the history
nfsserver: fix "server scope" to live with additional drop-in files
  • Loading branch information
oalbrigt authored Feb 20, 2023
2 parents 9bcb9d5 + 806e3fe commit f49caa9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion heartbeat/nfsserver
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,9 @@ inject_unshare_uts_name_into_systemd_units ()
test -d "$dir" || mkdir -p "$dir"
test -e "$dropin" && rm -f "$dropin"

edited_exec_start=$(systemctl cat $svc | sed -ne "s#^ExecStart=\\([-+:!@]*\\)\\(.*\\)#ExecStart=\\1/usr/bin/unshare --uts /bin/sh -c 'hostname \${NFS_SERVER_SCOPE}; exec \"\$@\"' -- \\2#p")
# NOTE: additional ExecStart= might exist in the drop-in files, eg. openSUSE
edited_exec_start=$(systemctl cat $svc | sed -ne "s#^ExecStart=\\([-+:!@]*\\)\\(.\+\\)#ExecStart=\\1/usr/bin/unshare --uts /bin/sh -c 'hostname \${NFS_SERVER_SCOPE}; exec \"\$@\"' -- \\2#p" | tail -1)

cat > "$dropin" <<___
[Service]
EnvironmentFile=$SYSTEMD_ENVIRONMENT_FILE_NFS_SERVER_SCOPE
Expand Down

0 comments on commit f49caa9

Please sign in to comment.