Skip to content

Instantly share code, notes, and snippets.

@themasch
Created August 26, 2013 12:45
Show Gist options
  • Save themasch/6341064 to your computer and use it in GitHub Desktop.
Save themasch/6341064 to your computer and use it in GitHub Desktop.
gitlab init script for gentoo
#!/sbin/runscript
# GitLab 6.0 init script for Gentoo Linux
# see https://github.com/gitlabhq/gitlabhq/blob/master/doc/installation.md
GITLAB_BASE=/home/git/gitlabhq
GITLAB_USER=git
depend() {
need net
}
start() {
ebegin "Starting gitlab application server"
start-stop-daemon --start \
--chdir "${GITLAB_BASE}" \
--user "${GITLAB_USER}" \
--pidfile "${GITLAB_BASE}/tmp/pids/appsrv" \
--background \
--exec bundle -- exec unicorn_rails -c "${GITLAB_BASE}/config/unicorn.rb" -E production
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 application server"
start-stop-daemon --stop \
--chdir "${GITLAB_BASE}" \
--user "${GITLAB_USER}" \
--pidfile "${GITLAB_BASE}/tmp/pids/appsrv"
eend $?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment