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" \
31 --exec "$DAEMON" -- "run" >> $LOGFILE 2>&1
35 start-stop-daemon --stop --pidfile "$PIDFILE" --user "$USER" --exec "$DAEMON" --quiet
39 # Check if the service is already running?
40 if [ -f /var/lock/subsys/$NAME ]; then
41 msg_already_running "$DESC"
48 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$NAME
52 if [ ! -f /var/lock/subsys/$NAME ]; then
53 msg_not_running "$DESC"
60 rm -f /var/lock/subsys/$NAME
64 if [ ! -f /var/lock/subsys/$NAME ]; then
65 msg_not_running "$DESC"
75 # See how we were called.
94 status --pidfile $PIDFILE $NAME
98 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"