From 3a4b259c2bc049f7a398c9437241453e1630d675 Mon Sep 17 00:00:00 2001 From: ApplBoy Date: Sun, 26 Jan 2025 22:59:01 -0300 Subject: [PATCH] Update actions-runner service Signed-off-by: ApplBoy --- services/systemd/actions-runner/actions-runner.service | 8 +++++--- services/systemd/install.sh | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/services/systemd/actions-runner/actions-runner.service b/services/systemd/actions-runner/actions-runner.service index 521ce0a..4ad0973 100644 --- a/services/systemd/actions-runner/actions-runner.service +++ b/services/systemd/actions-runner/actions-runner.service @@ -4,12 +4,14 @@ After=network.target [Service] User=${USER} -WorkingDirectory=${HOME}/actions-runner -ExecStart=${HOME}/actions-runner/run.sh +WorkingDirectory=${PROJECT_DIR}/actions-runner +ExecStart=bash ${PROJECT_DIR}/actions-runner/run.sh Restart=always RestartSec=10 -Environment=PATH=/usr/bin:/usr/local/bin:${HOME}/actions-runner +Environment=PATH=/usr/bin:/usr/local/bin:${PROJECT_DIR}/actions-runner Environment=HOME=${HOME} +StandardOutput=journal +StandardError=journal [Install] WantedBy=multi-user.target diff --git a/services/systemd/install.sh b/services/systemd/install.sh index 92d9e77..b1c2280 100755 --- a/services/systemd/install.sh +++ b/services/systemd/install.sh @@ -18,6 +18,8 @@ function parse_service_file() { file_dir=$(dirname "$file_path") temp_file="${file_dir}/.temp_$(basename "$file_path")" + project_dir=$(realpath "$script_dir/..") + export PROJECT_DIR="$project_dir" envsubst <"$file_path" >"$temp_file" }