-
-
Save maca/479d013cd2bbc427b647 to your computer and use it in GitHub Desktop.
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-CI 4.3 init script for Gentoo Linux | |
GITLAB_BASE=/home/gitlab_ci/gitlab-ci | |
GITLAB_USER=gitlab_ci | |
depend() { | |
need net redis | |
} | |
start() { | |
ebegin "Starting gitlab-ci 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