3 # gitlab-workhorse GitLab Workhorse
6 # description: Runs GitLab Workhorse
7 # processname: gitlab-workhorse
9 # Source function library
10 . /etc/rc.d/init.d/functions
13 . /etc/sysconfig/network
15 # Check that networking is up.
16 if is_yes "${NETWORKING}"; then
17 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
18 msg_network_down "GitLab Workhorse"
25 ### Environment variables
26 RAILS_ENV="production"
28 # The username and path to the gitlab source
30 APP_PATH=/usr/lib/gitlab
32 # The PID and LOCK files
33 pidfile=/var/run/gitlab/gitlab-workhorse.pid
34 lockfile=/var/lock/subsys/gitlab-workhorse
36 # Get service config - may override defaults
37 [ -f /etc/sysconfig/gitlab-workhorse ] && . /etc/sysconfig/gitlab-workhorse
40 # Check if the service is already running?
41 if [ -f $lockfile ]; then
42 msg_already_running "GitLab Workhorse"
46 msg_starting "GitLab Workhorse"
47 # initlog would cause fd1 and fd2 to be pipe
48 # those won't exist when workhorse tries to write to stdout causing it to abort with SIGPIPE
49 # http://lists.pld-linux.org/mailman/pipermail/pld-devel-en/2016-September/025111.html
51 daemon --pidfile $pidfile --user $USER --makepid --chdir "$APP_PATH" --redirfds --fork \
52 /usr/sbin/gitlab-workhorse $OPTIONS $LISTEN_OPTIONS
54 [ $RETVAL -eq 0 ] && touch $lockfile
58 if [ ! -f $lockfile ]; then
59 msg_not_running "GitLab Workhorse"
64 msg_stopping "GitLab Workhorse"
65 killproc --pidfile $pidfile gitlab-workhorse
71 if [ ! -f $lockfile ]; then
72 msg_not_running "GitLab Workhorse"
82 # See how we were called.
101 status --pidfile $pidfile gitlab-workhorse
105 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"