Created
October 23, 2021 19:31
-
-
Save suda/ba2fc6602239b15689aa79aa58ed998f 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
#!/bin/sh | |
# PROVIDE: gitlab_runner | |
# REQUIRE: DAEMON NETWORKING | |
# BEFORE: | |
# KEYWORD: | |
. /etc/rc.subr | |
name="gitlab_runner" | |
rcvar="gitlab_runner_enable" | |
user="gitlab-runner" | |
user_home="/home/gitlab-runner" | |
command="/usr/local/bin/gitlab-runner" | |
command_args="run" | |
pidfile="/var/run/${name}.pid" | |
start_cmd="gitlab_runner_start" | |
gitlab_runner_start() | |
{ | |
export USER=${user} | |
export HOME=${user_home} | |
if checkyesno ${rcvar}; then | |
cd ${user_home} | |
/usr/sbin/daemon -u ${user} -p ${pidfile} ${command} ${command_args} > /var/log/gitlab_runner.log 2>&1 | |
fi | |
} | |
load_rc_config $name | |
run_rc_command $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment