-
-
Save maca/94b5d5a1a665f1089795 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/sbin/runscript | |
# GitLab Runner init script for Gentoo Linux | |
GITLAB_RUNNER_BASE=/home/runner/gitlab-runners/gitlab-ci-runner | |
GITLAB_RUNNER_USER=runner | |
depend() { | |
need net | |
} | |
start() { | |
ebegin "Starting gitlab-runner" | |
[[ -d ${GITLAB_RUNNER_BASE}/tmp/pids ]] || su $GITLAB_RUNNER_USER -c "mkdir -p ${GITLAB_RUNNER_BASE}/tmp/pids" | |
start-stop-daemon --start \ | |
--chdir "${GITLAB_RUNNER_BASE}/" \ | |
--user "${GITLAB_RUNNER_USER}" \ | |
--background \ | |
--pidfile "${GITLAB_RUNNER_BASE}/tmp/pids/runner.pid" \ | |
--exec bundle -- exec ./bin/runner | |
# this does not yet create a PID file, why? | |
eend $? | |
} | |
stop() { | |
ebegin "Stopping gitlab-runner" | |
start-stop-daemon --stop \ | |
--chdir "${GITLAB_RUNNER_BASE}/" \ | |
--user "${GITLAB_RUNNER_USER}" \ | |
--pidfile "${GITLAB_RUNNER_BASE}/tmp/pids/runner.pid" | |
eend $? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment