intermediate commit
This commit is contained in:
parent
3e3f92135e
commit
5a4363382d
5 changed files with 174 additions and 6 deletions
43
www-apps/gitlab-ce/files/gitlab-sidekiq-8.2.init
Normal file
43
www-apps/gitlab-ce/files/gitlab-sidekiq-8.2.init
Normal file
|
@ -0,0 +1,43 @@
|
|||
#!/sbin/runscript
|
||||
|
||||
name="GitLab Sidekiq"
|
||||
description="Sidekiq for GitLab"
|
||||
|
||||
: ${gitlab_user:=@USER@}
|
||||
: ${gitlab_base:="@GITLAB_BASE@"}
|
||||
: ${rails_env:=production}
|
||||
|
||||
: ${sidekiq_pidfile:="/run/gitlab/sidekiq.pid"}
|
||||
: ${sidekiq_logfile:="@LOGS_DIR@/sidekiq.log"}
|
||||
: ${sidekiq_queues:="@QUEUES@"}
|
||||
|
||||
sidekiq_command="/usr/bin/bundle"
|
||||
sidekiq_command_args="exec sidekiq -q ${sidekiq_queues} -P ${sidekiq_pidfile} -L ${sidekiq_logfile}"
|
||||
|
||||
depend() {
|
||||
need redis
|
||||
use net gitlab-workhorse
|
||||
}
|
||||
|
||||
start() {
|
||||
checkpath -d -o ${gitlab_user} -m755 "$(dirname "${sidekiq_pidfile}")"
|
||||
|
||||
ebegin "Starting ${name} - Sidekiq"
|
||||
|
||||
start-stop-daemon --start \
|
||||
--background --quiet \
|
||||
--chdir "${gitlab_base}" \
|
||||
--user=${gitlab_user} \
|
||||
--pidfile="${sidekiq_pidfile}" \
|
||||
--env RAILS_ENV=${rails_env} \
|
||||
--exec ${sidekiq_command} -- ${sidekiq_command_args}
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping ${name} - Sidekiq"
|
||||
start-stop-daemon --stop \
|
||||
--pidfile=${sidekiq_pidfile} \
|
||||
--exec ${sidekiq_command}
|
||||
eend $?
|
||||
}
|
97
www-apps/gitlab-ce/files/gitlab-unicorn-8.2.init
Normal file
97
www-apps/gitlab-ce/files/gitlab-unicorn-8.2.init
Normal file
|
@ -0,0 +1,97 @@
|
|||
#!/sbin/runscript
|
||||
|
||||
name="GitLab"
|
||||
description="GitLab on Unicorns"
|
||||
|
||||
: ${gitlab_user:=@USER@}
|
||||
: ${gitlab_base:="@GITLAB_BASE@"}
|
||||
: ${rails_env:=production}
|
||||
|
||||
: ${server_pidfile:="/run/gitlab/unicorn.pid"}
|
||||
|
||||
: ${sidekiq_pidfile:="/run/gitlab/sidekiq.pid"}
|
||||
: ${sidekiq_logfile:="@LOGS_DIR@/sidekiq.log"}
|
||||
: ${sidekiq_queues:="@QUEUES@"}
|
||||
|
||||
: ${mail_room_pidfile:="/run/gitlab/mail_room.pid"}
|
||||
: ${mail_room_logfile:="/var/log/gitlab/mail_room.log"}
|
||||
: ${mail_room_config:="/etc/gitlab/mail_room.yml"}
|
||||
|
||||
server_command="/usr/bin/bundle"
|
||||
server_command_args="exec unicorn_rails -c ${gitlab_base}/config/unicorn.rb -E ${rails_env} -D"
|
||||
|
||||
sidekiq_command="/usr/bin/bundle"
|
||||
sidekiq_command_args="exec sidekiq -q ${sidekiq_queues//,/ -q } -P ${sidekiq_pidfile} -L ${sidekiq_logfile}"
|
||||
|
||||
mail_room_command="/usr/bin/bundle"
|
||||
mail_room_command_args="exec mail_room -q -c ${mail_room_config} >> ${mail_room_logfile} 2>&1"
|
||||
|
||||
depend() {
|
||||
provide gitlab
|
||||
need redis
|
||||
use net gitlab-workhorse
|
||||
}
|
||||
|
||||
start() {
|
||||
ebegin "Starting ${name} - Unicorn servers"
|
||||
|
||||
checkpath -d -o ${gitlab_user} -m755 "$(dirname "${server_pidfile}")"
|
||||
checkpath -d -o ${gitlab_user} -m755 "$(dirname "${sidekiq_pidfile}")"
|
||||
|
||||
start-stop-daemon --start \
|
||||
--chdir "${gitlab_base}" \
|
||||
--user=${gitlab_user} \
|
||||
--pidfile="${server_pidfile}" \
|
||||
--env RAILS_ENV=${rails_env} \
|
||||
--exec ${server_command} -- ${server_command_args}
|
||||
eend $?
|
||||
|
||||
ebegin "Starting ${name} - Sidekiq"
|
||||
|
||||
start-stop-daemon --start \
|
||||
--background --quiet \
|
||||
--chdir "${gitlab_base}" \
|
||||
--user=${gitlab_user} \
|
||||
--pidfile="${sidekiq_pidfile}" \
|
||||
--env RAILS_ENV=${rails_env} \
|
||||
--exec ${sidekiq_command} -- ${sidekiq_command_args}
|
||||
eend $?
|
||||
|
||||
if [ -e /etc/default/gitlab ]; then
|
||||
. /etc/default/gitlab
|
||||
if [ "${mail_room_enabled}" == "true" ]; then
|
||||
ebegin "Starting ${name} - mail_room"
|
||||
|
||||
start-stop-daemon --start \
|
||||
--background --quiet \
|
||||
--chdir "${gitlab_base}" \
|
||||
--user=${gitlab_user} \
|
||||
--pidfile="${mail_room_pidfile}" \
|
||||
--env RAILS_ENV=${rails_env} \
|
||||
--exec ${mail_room_command} -- ${mail_room_command_args}
|
||||
eend $?
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping ${name} - mail_room"
|
||||
start-stop-daemon --stop \
|
||||
--signal QUIT \
|
||||
--pidfile=${mail_room_pidfile} \
|
||||
--exec ${mail_room_command}
|
||||
eend $?
|
||||
|
||||
ebegin "Stopping ${name} - Sidekiq"
|
||||
start-stop-daemon --stop \
|
||||
--pidfile=${sidekiq_pidfile} \
|
||||
--exec ${sidekiq_command}
|
||||
eend $?
|
||||
|
||||
ebegin "Stopping ${name} - Unicorn servers"
|
||||
start-stop-daemon --stop \
|
||||
--signal QUIT \
|
||||
--pidfile=${server_pidfile} \
|
||||
--exec ${server_command}
|
||||
eend $?
|
||||
}
|
25
www-apps/gitlab-ce/files/gitlab-workhorse.service
Normal file
25
www-apps/gitlab-ce/files/gitlab-workhorse.service
Normal file
|
@ -0,0 +1,25 @@
|
|||
#####################################################
|
||||
#
|
||||
# GitLab version : 8.2 - 8.x
|
||||
# Contributors : davispuh, mtorromeo, axilleas, boeserwolf91, Stefan Tatschner (rumpelsepp)
|
||||
# Downloaded from : https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/init/systemd
|
||||
#
|
||||
####################################################
|
||||
|
||||
[Unit]
|
||||
Description=Gitlab Workhorse
|
||||
Requires=gitlab-unicorn.service
|
||||
Wants=gitlab-unicorn.service
|
||||
After=gitlab-unicorn.service
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
User=git
|
||||
WorkingDirectory=/opt/gitlab
|
||||
SyslogIdentifier=gitlab-workhorse
|
||||
PIDFile=/run/gitlab/gitlab-workhorse.pid
|
||||
|
||||
ExecStart=/opt/gitlab/bin/daemon_with_pidfile /run/gitlab/gitlab-workhorse.pid /usr/bin/gitlab-workhorse -listenUmask 0 -listenNetwork unix -listenAddr /run/gitlab/gitlab-workhorse.socket -authBackend http://127.0.0.1:8080 /var/lib/git/repositories/ >> /var/log/gitlab/gitlab-workhorse.log 2>&1
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Add table
Add a link
Reference in a new issue