Skip to content

Instantly share code, notes, and snippets.

@jirutka
Last active March 18, 2016 05:28
Show Gist options
  • Save jirutka/f2162958c9deb3c5cc60 to your computer and use it in GitHub Desktop.
Save jirutka/f2162958c9deb3c5cc60 to your computer and use it in GitHub Desktop.
Upstart job configuration files (aka runscripts) for GitLab CE.
#!upstart
description "GitLab (Sidekiq)"
author "Jakub Jirutka"
start on starting gitlab
stop on stopping gitlab
env sidekiq_logfile="/var/log/gitlab/sidekiq.log"
env sidekiq_queues="-q post_receive -q mailer -q system_hook
-q project_web_hook -q gitlab_shell -q common -q default"
setuid git
chdir /opt/gitlab
exec /usr/local/bin/bundle exec sidekiq -L $sidekiq_logfile -e production $sidekiq_queues
#!upstart
description "GitLab (web)"
author "Jakub Jirutka"
start on starting gitlab and started gitlab-sidekiq
stop on stopping gitlab and stopping gitlab-sidekiq
env unicorn_config="/opt/gitlab/config/unicorn.rb"
reload signal USR1
setuid git
chdir /opt/gitlab
exec /usr/local/bin/bundle exec unicorn_rails -c $unicorn_config -E production
#!upstart
description "GitLab"
author "Jakub Jirutka"
# postgresql is not an upstart service, so we can't depend on it :(
start on filesystem and started redis-server
stop on runlevel [016]
pre-start script
# Prepare directory for the socket.
mkdir -p -m 755 /run/gitlab
chown git /run/gitlab
end script
#!upstart
description "Redis server"
author "Jakub Jirutka"
start on filesystem
stop on runlevel [016]
env redis_conf="/etc/redis/redis.conf"
env socket_dir="/run/redis"
expect fork
pre-start script
mkdir -p -m 755 $socket_dir
chown redis:redis $socket_dir
end script
exec start-stop-daemon \
--start \
--chuid redis:redis \
--umask 007 \
--exec /usr/bin/redis-server $redis_conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment