summaryrefslogtreecommitdiff
path: root/dev-util/gitlab-runner/files/gitlab-runner.initd
diff options
context:
space:
mode:
Diffstat (limited to 'dev-util/gitlab-runner/files/gitlab-runner.initd')
-rw-r--r--dev-util/gitlab-runner/files/gitlab-runner.initd38
1 files changed, 38 insertions, 0 deletions
diff --git a/dev-util/gitlab-runner/files/gitlab-runner.initd b/dev-util/gitlab-runner/files/gitlab-runner.initd
new file mode 100644
index 000000000000..0e5c5ed224b6
--- /dev/null
+++ b/dev-util/gitlab-runner/files/gitlab-runner.initd
@@ -0,0 +1,38 @@
+#!/sbin/openrc-run
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+command="/usr/bin/gitlab-runner"
+runner_datadir="${runner_datadir:-/var/lib/gitlab-runner}"
+command_args="run
+ --config ${runner_config:-/etc/gitlab-runner/config.toml}
+ --service ${runner_service:-${RC_SVCNAME}}
+ --user ${runner_user:-gitlab-runner}
+ --working-directory ${runner_datadir}
+ ${RUNNER_OPTS}"
+command_background=true
+extra_started_commands="reload"
+name="${name:-GitLab Runner}"
+pidfile="/run/${RC_SVCNAME}.pid"
+runner_user="${runner_user:-gitlab-runner}"
+runner_logdir="${runner_logdir:-/var/log/gitlab-runner}"
+output_log="${output_log:-${runner_logdir}/gitlab-runner.log}"
+error_log="${error_log:-${runner_logdir}/gitlab-runner.err}"
+retry="QUIT/60/TERM/60"
+required_files="${runner_config}"
+
+depend() {
+ need localmount
+ after net.lo loopback
+}
+
+start_pre() {
+ checkpath -d -m 0700 -o "${runner_user}" "${runner_datadir}"
+ checkpath -d -m 0750 -o "${runner_user}" "${runner_logdir}"
+}
+
+reload() {
+ ebegin "Reloading ${name} configuration"
+ start-stop-daemon --signal HUP --pidfile "${pidfile}"
+ eend $? "Failed to reload ${name}"
+}