Skip to content

Instantly share code, notes, and snippets.

@666threesixes666
Created June 28, 2013 05:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 666threesixes666/5882741 to your computer and use it in GitHub Desktop.
Save 666threesixes666/5882741 to your computer and use it in GitHub Desktop.
gitlab init script
#!/sbin/runscript
# GitLab 5.3 init script for Gentoo Linux
# see https://github.com/gitlabhq/gitlabhq/blob/master/doc/installation.md
GITLAB_BASE=/home/git/gitlab
GITLAB_USER=git
depend() {
need net redis
}
start() {
ebegin "Starting gitlab puma server"
start-stop-daemon --start \
--chdir "${GITLAB_BASE}" \
--user "${GITLAB_USER}" \
--pidfile "${GITLAB_BASE}/tmp/pids/puma.pid" \
--exec bundle -- exec puma -C $GITLAB_BASE/config/puma.rb RAILS_ENV=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 puma server"
start-stop-daemon --stop \
--chdir "${GITLAB_BASE}" \
--user "${GITLAB_USER}" \
--pidfile "${GITLAB_BASE}/tmp/pids/puma.pid"
eend $?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment