From 6abd9d92b966a1491441eb2b28618754a3f0c15d Mon Sep 17 00:00:00 2001 From: Kevin Lamontagne Date: Tue, 18 Jun 2013 12:57:50 -0400 Subject: [PATCH] Remove unicorn files for 5.x --- templates/default/gitlab.sh.erb | 7 --- templates/default/unicorn.rb.erb | 63 ---------------------- templates/default/unicorn_rails.init.erb | 69 ------------------------ 3 files changed, 139 deletions(-) delete mode 100644 templates/default/gitlab.sh.erb delete mode 100644 templates/default/unicorn.rb.erb delete mode 100644 templates/default/unicorn_rails.init.erb diff --git a/templates/default/gitlab.sh.erb b/templates/default/gitlab.sh.erb deleted file mode 100644 index 19ed7c1..0000000 --- a/templates/default/gitlab.sh.erb +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -# Generated by Chef for <%= @fqdn %> -# Local modifications will be overwritten. -RUBY_DIR="/usr/local/ruby/<%= @install_ruby %>" -if ! echo ${PATH} | /bin/grep -q $RUBY_DIR/bin ; then - PATH=$RUBY_DIR/bin:${PATH} -fi diff --git a/templates/default/unicorn.rb.erb b/templates/default/unicorn.rb.erb deleted file mode 100644 index 6a7af8f..0000000 --- a/templates/default/unicorn.rb.erb +++ /dev/null @@ -1,63 +0,0 @@ -# Generated by Chef for <%= @fqdn %> -# Local modifications will be overwritten. -app_dir = "<%= @gitlab_app_home %>" -worker_processes 2 -working_directory app_dir - -# Load app into the master before forking workers for super-fast -# worker spawn times -preload_app true - -# nuke workers after 60 seconds (the default) -timeout 30 - -# listen on a Unix domain socket and/or a TCP port, - -#listen 8080 # listen to port 8080 on all TCP interfaces -#listen "127.0.0.1:8080" # listen to port 8080 on the loopback interface -listen "#{app_dir}/tmp/sockets/gitlab.socket" - -pid "#{app_dir}/tmp/pids/unicorn.pid" -stderr_path "#{app_dir}/log/unicorn.stderr.log" -stdout_path "#{app_dir}/log/unicorn.stdout.log" - -# http://www.rubyenterpriseedition.com/faq.html#adapt_apps_for_cow -if GC.respond_to?(:copy_on_write_friendly=) - GC.copy_on_write_friendly = true -end - - -before_fork do |server, worker| - # the following is highly recomended for Rails + "preload_app true" - # as there's no need for the master process to hold a connection - defined?(ActiveRecord::Base) and ActiveRecord::Base.connection.disconnect! - - ## - # When sent a USR2, Unicorn will suffix its pidfile with .oldbin and - # immediately start loading up a new version of itself (loaded with a new - # version of our app). When this new Unicorn is completely loaded - # it will begin spawning workers. The first worker spawned will check to - # see if an .oldbin pidfile exists. If so, this means we've just booted up - # a new Unicorn and need to tell the old one that it can now die. To do so - # we send it a QUIT. - # - # Using this method we get 0 downtime deploys. - - old_pid = "#{server.config[:pid]}.oldbin" - - if File.exists?(old_pid) && server.pid != old_pid - begin - sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU - Process.kill(sig, File.read(old_pid).to_i) - rescue Errno::ENOENT, Errno::ESRCH - # someone else did our job for us - end - end -end - -after_fork do |server, worker| -# Here we are establishing the connection after forking worker -# processes - defined?(ActiveRecord::Base) and - ActiveRecord::Base.establish_connection -end diff --git a/templates/default/unicorn_rails.init.erb b/templates/default/unicorn_rails.init.erb deleted file mode 100644 index 7f36887..0000000 --- a/templates/default/unicorn_rails.init.erb +++ /dev/null @@ -1,69 +0,0 @@ -#! /bin/bash - -# Generated by Chef for <%= @fqdn %> -# Local modifications will be overwritten. - -# unicorn_rails init script for Linux -# -# chkconfig: 2345 60 40 -# description: unicorn_rails init script for Gitlab -# processname: unicorn_rails - -### BEGIN INIT INFO -# Provides: unicorn_rails -# Required-Start: $local_fs $remote_fs $network $syslog -# Required-Stop: $local_fs $remote_fs $network $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: unicorn_rails init script -# Description: unicorn_rails init script as shipped with gitlab cookbook -### END INIT INFO - -DAEMON_OPTS="-c <%= @gitlab_app_home %>/config/unicorn.rb -E production -D" -NAME=unicorn_rails -DESC=gitlab -PID=<%= @gitlab_app_home %>/tmp/pids/unicorn.pid -RESQUE_PID=<%= @gitlab_app_home %>/tmp/pids/resque_worker.pid - -case "$1" in - start) - if [ -x /etc/profile.d/gitlab.sh ]; then - . /etc/profile.d/gitlab.sh - fi - CD_TO_APP_DIR="cd <%= @gitlab_app_home %>" - START_DAEMON_PROCESS="bundle exec unicorn_rails $DAEMON_OPTS" - START_RESQUE_PROCESS="./resque.sh" - - echo -n "Starting $DESC: " - if [ `whoami` = root ]; then - sudo -u gitlab sh -l -c "$CD_TO_APP_DIR > /dev/null 2>&1 && $START_DAEMON_PROCESS && $START_RESQUE_PROCESS" - else - $CD_TO_APP_DIR > /dev/null 2>&1 && $START_DAEMON_PROCESS && $START_RESQUE_PROCESS - fi - echo "$NAME." - ;; - stop) - echo -n "Stopping $DESC: " - kill -QUIT `cat $PID` - kill -QUIT `cat $RESQUE_PID` - echo "$NAME." - ;; - restart) - echo -n "Restarting $DESC: " - kill -USR2 `cat $PID` - kill -USR2 `cat $RESQUE_PID` - echo "$NAME." - ;; - reload) - echo -n "Reloading $DESC configuration: " - kill -HUP `cat $PID` - kill -HUP `cat $RESQUE_PID` - echo "$NAME." - ;; - *) - echo "Usage: $NAME {start|stop|restart|reload}" >&2 - exit 1 - ;; -esac - -exit 0