Skip to content
This repository has been archived by the owner on Jun 7, 2023. It is now read-only.

Spike using svc to start and stop #6

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

markpitchless
Copy link

Spike using the systemd service support to start the runner and have it self terminate.

https://docs.github.com/en/actions/hosting-your-own-runners/configuring-the-self-hosted-runner-application-as-a-service

'./run.sh',
`./config.sh --url https://github.com/${config.githubContext.owner}/${config.githubContext.repo} --token ${githubRegistrationToken} --name "$INSTANCE_ID" --labels ${label} --ephemeral`,
"sed -i 's/\\(ExecStart=.*\\)/\\1\\nExecStopPost=shutdown -h now/' bin/actions.runner.service.template",
'sudo ./svc.sh install',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EC2 user data scripts are run as root so you shouldn't need sudo here.

In a related vein, if you don't want to run the runner as root, you can also pass in a different user to run the service as. See example.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants