From 29cee5227690f48091d25a92b1cc3390e05f7fb1 Mon Sep 17 00:00:00 2001 From: Nikola Jokic <97525037+nikola-jokic@users.noreply.github.com> Date: Thu, 10 Mar 2022 14:08:19 +0100 Subject: [PATCH] Prefer user who initiated install before (#1714) --- src/Misc/layoutbin/darwin.svc.sh.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Misc/layoutbin/darwin.svc.sh.template b/src/Misc/layoutbin/darwin.svc.sh.template index 8657c9dda..e59adf5e3 100644 --- a/src/Misc/layoutbin/darwin.svc.sh.template +++ b/src/Misc/layoutbin/darwin.svc.sh.template @@ -63,7 +63,7 @@ function install() mkdir -p "${log_path}" || failed "failed to create ${log_path}" echo Creating ${PLIST_PATH} - sed "s/{{User}}/${SUDO_USER:-$USER}/g; s/{{SvcName}}/$SVC_NAME/g; s@{{RunnerRoot}}@${RUNNER_ROOT}@g; s@{{UserHome}}@$HOME@g;" "${TEMPLATE_PATH}" > "${TEMP_PATH}" || failed "failed to create replacement temp file" + sed "s/{{User}}/${USER:-$SUDO_USER}/g; s/{{SvcName}}/$SVC_NAME/g; s@{{RunnerRoot}}@${RUNNER_ROOT}@g; s@{{UserHome}}@$HOME@g;" "${TEMPLATE_PATH}" > "${TEMP_PATH}" || failed "failed to create replacement temp file" mv "${TEMP_PATH}" "${PLIST_PATH}" || failed "failed to copy plist" # Since we started with sudo, runsvc.sh will be owned by root. Change this to current login user.