Created
October 23, 2013 01:06
-
-
Save nheine/7110844 to your computer and use it in GitHub Desktop.
gentoo init.d script for gitlab 6.2
This file contains hidden or 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 6.2 init script for Gentoo Linux | |
GITLAB_BASE=/home/git/gitlab | |
GITLAB_USER=git | |
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 \ | |
--pidfile "${GITLAB_BASE}/tmp/pids/unicorn.pid" \ | |
--exec "${GITLAB_BASE}/script/web" -- start | |
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 "${GITLAB_BASE}/script/background_jobs" -- start | |
eend $? | |
} | |
stop() { | |
ebegin "Stopping gitlab sidekiq" | |
start-stop-daemon --stop \ | |
--chdir "${GITLAB_BASE}/" \ | |
--user "${GITLAB_USER}" \ | |
--pidfile "${GITLAB_BASE}/tmp/pids/sidekiq.pid" \ | |
--env RAILS_ENV=production \ | |
--exec "${GITLAB_BASE}/script/background_jobs" -- stop | |
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" \ | |
--env RAILS_ENV=production \ | |
--exec "${GITLAB_BASE}/script/web" -- stop | |
eend $? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment