This repository was archived by the owner on May 12, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +50
-18
lines changed Expand file tree Collapse file tree 3 files changed +50
-18
lines changed Original file line number Diff line number Diff line change @@ -123,9 +123,15 @@ exit;
123123cd /home/gitlab_ci_runner/gitlab-ci-runner
124124sudo cp ./lib/support/init.d/gitlab_ci_runner /etc/init.d/gitlab-ci-runner
125125sudo chmod +x /etc/init.d/gitlab-ci-runner
126- sudo update-rc.d gitlab-ci-runner defaults 21
126+ sudo update-rc.d gitlab-ci-runner defaults 21
127127```
128128
129+ ### Runners default file
130+
131+ ```
132+ cd /home/gitlab_ci_runner/gitlab-ci-runner
133+ sudo cp ./lib/support/init.d/gitlab_ci_runner.default.example /etc/default/gitlab_ci_runner
134+ ```
129135
130136### Run
131137
@@ -154,7 +160,7 @@ bundle exec bin/runner -C /my/runner/working/directory
154160
155161### Update
156162
157- In order to update the runner to a new version just go to runner directory and do next:
163+ In order to update the runner to a new version just go to runner directory and do next:
158164
159165``` bash
160166sudo su gitlab_ci_runner
@@ -181,4 +187,3 @@ Now the runner will start to pick up builds automatically. When you are done wit
181187## Development
182188
183189To work on the GitLab runner we recommend you install the [ GitLab Development Kit] ( https://gitlab.com/gitlab-org/gitlab-development-kit ) .
184-
Original file line number Diff line number Diff line change 77# Default-Start: 2 3 4 5
88# Default-Stop: 0 1 6
99# Short-Description: GitLab CI Runner init.d script
10- # Description: Enables automatic start of runners at boot time in the background.
10+ # Description: Enables automatic start of runners at boot time in the background.
1111# ## END INIT INFO
1212
1313APP_ROOT=" /home/gitlab_ci_runner/gitlab-ci-runner"
@@ -21,6 +21,9 @@ DESC="GitLab CI runner"
2121RUNNERS_REGISTERED=0
2222INIT_LOG=" /var/log/gitlab_ci_runner.log"
2323
24+ # Read configuration variable file if it is present
25+ test -f /etc/default/gitlab_ci_runner && . /etc/default/gitlab_ci_runner
26+
2427check_pid () {
2528 PROCESS_ID=0
2629 [ -f $RUNNER_PID ] && PROCESS_ID=` cat $RUNNER_PID `
@@ -45,7 +48,6 @@ start() {
4548 [ ! -f $PID_PATH ] && execute " mkdir -p $PID_PATH "
4649 [ -f $RUNNER_PID ] && execute " rm -f $RUNNER_PID "
4750
48-
4951 # Check log file
5052 if [ ! -f $INIT_LOG ]; then
5153 touch $INIT_LOG
@@ -60,7 +62,7 @@ start() {
6062stop () {
6163 check_pid
6264 echo -n " Trying to stop registered runner..."
63-
65+
6466 if [ $PROCESS_ID -gt 0 ]; then
6567 execute " cat $RUNNER_PID | xargs kill -USR2"
6668 rm -f $RUNNER_PID
8486
8587case " $1 " in
8688 start)
87- start
88- ;;
89+ start
90+ ;;
8991 stop)
90- stop
91- ;;
92+ stop
93+ ;;
9294 restart)
93- stop
94- start
95- ;;
95+ stop
96+ start
97+ ;;
9698 status)
97- status
98- ;;
99+ status
100+ ;;
99101 * )
100- echo " Usage: sudo service gitlab_ci_runner {start|stop|restart|status}" >&2
101- exit 1
102- ;;
102+ echo " Usage: sudo service gitlab_ci_runner {start|stop|restart|status}" >&2
103+ exit 1
104+ ;;
103105esac
104106
105107exit 0
Original file line number Diff line number Diff line change 1+ # Copy this lib/support/init.d/gitlab_ci_runner.default.example file to
2+ # /etc/default/gitlab_ci_runner in order for it to apply to your system.
3+
4+ # app_user defines the user that GitLab is run as.
5+ # The default is "gitlab_ci_runner".
6+ APP_USER="gitlab_ci_runner"
7+
8+ # app_root defines the folder in which gitlab and it's components are installed.
9+ # The default is "/home/$app_user/gitlab-ci-runner"
10+ APP_ROOT="/home/$APP_USER/gitlab-ci-runner"
11+
12+ # pid_path defines a folder in which the gitlab-ci-runner place its pid.
13+ # This variable is also used below to define the relevant pids for the gitlab_ci_runner components.
14+ # The default is "$app_root/tmp/pids"
15+ PID_PATH="$APP_ROOT/tmp/pids"
16+
17+ # init_log defines a file in which the runners write their log messages.
18+ # The default is "/var/log/gitlab_ci_runner.log"
19+ INIT_LOG="/var/log/gitlab_ci_runner.log"
20+
21+ # Runner Configuration
22+
23+ # runners_pid_path defines a file in which the individual runners place their pids.
24+ # The default is "$pid_path/runners.pid"
25+ RUNNERS_PID="$PID_PATH/runners.pid"
You can’t perform that action at this time.
0 commit comments