Skip to content

Instantly share code, notes, and snippets.

@andmarios
Last active July 24, 2019 07:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save andmarios/4607331 to your computer and use it in GitHub Desktop.
Save andmarios/4607331 to your computer and use it in GitHub Desktop.
Gitlab 4.1 init script for Gentoo Linux
#!/sbin/runscript
# GitLab 4.1 init script for Gentoo Linux
# see https://github.com/gitlabhq/gitlabhq/blob/master/doc/installation.md
GITLAB_BASE=/home/gitlab/gitlab
GITLAB_USER=gitlab
depend() {
need net redis
}
start() {
ebegin "Starting gitlab unicorn server"
start-stop-daemon --start \
--chdir "${GITLAB_BASE}" \
--user "${GITLAB_USER}" \
--pidfile "${GITLAB_BASE}/tmp/pids/unicorn.pid" \
--exec bundle -- exec unicorn_rails -c "${GITLAB_BASE}/config/unicorn.rb" -E production -D
eend $?
ebegin "Starting gitlab sidekiq"
start-stop-daemon --start \
--chdir "${GITLAB_BASE}" \
--user "${GITLAB_USER}" \
--pidfile "${GITLAB_BASE}/tmp/pids/sidekiq.pid" \
--exec bundle -- exec rake sidekiq:start RAILS_ENV=production
eend $?
}
stop() {
ebegin "Stopping gitlab sidekiq"
start-stop-daemon --stop \
--chdir "${GITLAB_BASE}" \
--user "${GITLAB_USER}" \
--pidfile "${GITLAB_BASE}/tmp/pids/sidekiq.pid"
eend $?
ebegin "Stopping gitlab unicorn server"
start-stop-daemon --stop \
--chdir "${GITLAB_BASE}" \
--user "${GITLAB_USER}" \
--pidfile "${GITLAB_BASE}/tmp/pids/unicorn.pid"
eend $?
}
@tarvitz
Copy link

tarvitz commented Feb 27, 2016

Thanks, confirm that this script would work perfect for 8.5 version too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment