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" }