From 1b971918a317be1162b19b78c12a749c77b1e588 Mon Sep 17 00:00:00 2001 From: Fabian Fulga Date: Fri, 13 Dec 2024 15:27:08 +0200 Subject: [PATCH] Add chown on RUN_HOME just for non-cached runner --- cloudconfig/templates.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cloudconfig/templates.go b/cloudconfig/templates.go index 1d9fb71..baf990e 100644 --- a/cloudconfig/templates.go +++ b/cloudconfig/templates.go @@ -89,7 +89,7 @@ function downloadAndExtractRunner() { mkdir -p "$RUN_HOME" || fail "failed to create actions-runner folder" sendStatus "extracting runner" tar xf "/home/{{ .RunnerUsername }}/{{ .FileName }}" -C "$RUN_HOME"/ || fail "failed to extract runner" - # chown {{ .RunnerUsername }}:{{ .RunnerGroup }} -R "$RUN_HOME"/ || fail "failed to change owner" + chown {{ .RunnerUsername }}:{{ .RunnerGroup }} -R "$RUN_HOME"/ || fail "failed to change owner" } if [ ! -d "$RUN_HOME" ];then @@ -132,7 +132,8 @@ fi sendStatus "enabling runner service" cp "$RUN_HOME"/bin/runsvc.sh "$RUN_HOME"/ || fail "failed to copy runsvc.sh" -sudo chown {{ .RunnerUsername }}:{{ .RunnerGroup }} -R /home/{{ .RunnerUsername }} || fail "failed to change owner" +# Chown is not needed for the cached runner +# sudo chown {{ .RunnerUsername }}:{{ .RunnerGroup }} -R /home/{{ .RunnerUsername }} || fail "failed to change owner" sudo systemctl daemon-reload || fail "failed to reload systemd" sudo systemctl enable $SVC_NAME {{- else}}