Last active
December 21, 2015 15:58
-
-
Save limansky/6330226 to your computer and use it in GitHub Desktop.
GitLab initscript for 6-0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/sbin/runscript | |
# GitLab 5.2 and 5.3 init script for Gentoo Linux | |
# see https://github.com/gitlabhq/gitlabhq/blob/master/doc/installation.md | |
GITLAB_BASE=/mnt/data/gitlab/gitlab | |
GITLAB_USER=gitlab | |
depend() { | |
need net redis | |
} | |
start() { | |
ebegin "Starting gitlab unicorn server" | |
[[ -d ${GITLAB_BASE}/tmp/pids ]] || su $GITLAB_USER -c "mkdir -p ${GITLAB_BASE}/tmp/pids" | |
start-stop-daemon --start \ | |
--chdir "${GITLAB_BASE}" \ | |
--user "${GITLAB_USER}" \ | |
--background \ | |
--env RAILS_ENV=production \ | |
--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" \ | |
--background \ | |
--env RAILS_ENV=production \ | |
--exec bundle -- exec rake sidekiq:start | |
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}" \ | |
--signal QUIT \ | |
--pidfile "${GITLAB_BASE}/tmp/pids/unicorn.pid" | |
eend $? | |
} |
I forked and made a version that supports CE-8 and the new gitlab-git-http-server piece.
https://gist.github.com/miguelitosd/dea48b1262f341135b4b
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have put an init script together for gitlab 6.2: https://gist.github.com/nheine/7110844