3 # gitlab-ci-multi-runner GitLab CI-Multi Runner
6 # description: Enables automatic start of runners at boot time in the background
7 # processname: gitlab-ci-multi-runner
9 # Source function library
10 . /etc/rc.d/init.d/functions
12 DESC="GitLab CI-Multi Runner"
15 CHDIR="/var/lib/gitlab-runner"
16 NAME="gitlab-ci-multi-runner"
17 DAEMON="/usr/bin/gitlab-ci-multi-runner"
18 PIDFILE="/var/run/gitlab-ci-multi-runner.pid"
19 LOGFILE="/var/log/gitlab-ci-multi-runner.log"
21 # Read configuration variable file if it is present
22 [ -f /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME
25 start-stop-daemon --start \
26 --pidfile "$PIDFILE" \
30 --chuid "$USER:$GROUP" \
32 --exec "$DAEMON" -- "run" >> $LOGFILE 2>&1
36 start-stop-daemon --stop --pidfile "$PIDFILE" --user "$USER" --exec "$DAEMON" --quiet
40 # Check if the service is already running?
41 if [ -f /var/lock/subsys/$NAME ]; then
42 msg_already_running "$DESC"
49 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$NAME
53 if [ ! -f /var/lock/subsys/$NAME ]; then
54 msg_not_running "$DESC"
61 rm -f /var/lock/subsys/$NAME
65 if [ ! -f /var/lock/subsys/$NAME ]; then
66 msg_not_running "$DESC"
76 # See how we were called.
95 status --pidfile $PIDFILE $NAME
99 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"