Skip to content

Commit

Permalink
Fix confusing situation where install guide told you to install init.…
Browse files Browse the repository at this point in the history
…d script for puma.
  • Loading branch information
dosire committed Aug 19, 2013
1 parent 6ec73fc commit 7c55c73
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 248 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ config/gitlab.yml
config/database.yml
config/initializers/omniauth.rb
config/unicorn.rb
config/puma.rb
config/resque.yml
config/aws.yml
db/data.yml
Expand Down
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ gem "github-markup", "~> 0.7.4", require: 'github/markup'
# Asciidoc to HTML
gem "asciidoctor"

# Servers
gem "puma", '~> 2.3.1', group: :puma
# Application server
gem "unicorn", '~> 4.6.3', group: :unicorn

# State machine
Expand Down
3 changes: 0 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,6 @@ GEM
coderay (~> 1.0.5)
method_source (~> 0.8)
slop (~> 3.4)
puma (2.3.1)
rack (>= 1.1, < 2.0)
pygments.rb (0.4.2)
posix-spawn (~> 0.3.6)
yajl-ruby (~> 1.1.0)
Expand Down Expand Up @@ -608,7 +606,6 @@ DEPENDENCIES
pg
poltergeist (~> 1.3.0)
pry
puma (~> 2.3.1)
quiet_assets (~> 1.0.1)
rack-mini-profiler
rails (= 3.2.13)
Expand Down
93 changes: 0 additions & 93 deletions config/puma.rb.example

This file was deleted.

2 changes: 1 addition & 1 deletion doc/make_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Check if any of these changed since last release (~22nd of last month depending
* https://github.com/gitlabhq/gitlabhq/commits/master/lib/support/nginx/gitlab
* https://github.com/gitlabhq/gitlab-shell/commits/master/config.yml.example
* https://github.com/gitlabhq/gitlabhq/commits/master/config/gitlab.yml.example
* https://github.com/gitlabhq/gitlabhq/commits/master/config/puma.rb.example
* https://github.com/gitlabhq/gitlabhq/commits/master/config/unicorn.rb.example
* https://github.com/gitlabhq/gitlabhq/commits/master/config/database.yml.mysql
* https://github.com/gitlabhq/gitlabhq/commits/master/config/database.yml.postgresql

Expand Down
18 changes: 8 additions & 10 deletions lib/support/init.d/gitlab
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# GITLAB
# Maintainer: @randx
# App Version: 5.2
# App Version: 6.0

### BEGIN INIT INFO
# Provides: gitlab
Expand All @@ -17,11 +17,10 @@

APP_ROOT="/home/git/gitlab"
APP_USER="git"
DAEMON_OPTS="-C $APP_ROOT/config/puma.rb"
DAEMON_OPTS="-c $APP_ROOT/config/unicorn.rb -E production"
PID_PATH="$APP_ROOT/tmp/pids"
SOCKET_PATH="$APP_ROOT/tmp/sockets"
SOCKET_FILE="$SOCKET_PATH/gitlab.socket"
WEB_SERVER_PID="$PID_PATH/puma.pid"
WEB_SERVER_PID="$PID_PATH/unicorn.pid"
SIDEKIQ_PID="$PID_PATH/sidekiq.pid"
STOP_SIDEKIQ="RAILS_ENV=production bundle exec rake sidekiq:stop"
START_SIDEKIQ="RAILS_ENV=production bundle exec rake sidekiq:start"
Expand Down Expand Up @@ -52,8 +51,8 @@ start() {
exit 1
else
if [ `whoami` = root ]; then
! [ -e $SOCKET_FILE ] || execute "rm $SOCKET_FILE"
execute "RAILS_ENV=production bundle exec puma $DAEMON_OPTS"
execute "rm -f $SOCKET_PATH/gitlab.socket"
execute "RAILS_ENV=production bundle exec unicorn_rails $DAEMON_OPTS > /dev/null 2>&1 &"
execute "mkdir -p $PID_PATH && $START_SIDEKIQ > /dev/null 2>&1 &"
echo "$DESC started"
fi
Expand All @@ -66,13 +65,12 @@ stop() {
if [ "$PID" -ne 0 -a "$STATUS" -ne 0 ]; then
## Program is running, stop it.
kill -QUIT `cat $WEB_SERVER_PID`
! [ -e $SOCKET_FILE ] || execute "rm $SOCKET_FILE"
execute "mkdir -p $PID_PATH && $STOP_SIDEKIQ > /dev/null 2>&1 &"
rm "$WEB_SERVER_PID" >> /dev/null
echo "$DESC stopped"
else
## Program is not running, exit with error.
echo "Error! $DESC is not started!"
echo "Error! $DESC not started!"
exit 1
fi
}
Expand All @@ -83,7 +81,7 @@ restart() {
if [ "$PID" -ne 0 -a "$STATUS" -ne 0 ]; then
echo "Restarting $DESC..."
kill -USR2 `cat $WEB_SERVER_PID`
execute "mkdir -p $PID_PATH && $STOP_SIDEKIQ > /dev/null 2>&1"
execute "mkdir -p $PID_PATH && $STOP_SIDEKIQ > /dev/null 2>&1 &"
if [ `whoami` = root ]; then
execute "mkdir -p $PID_PATH && $START_SIDEKIQ > /dev/null 2>&1 &"
fi
Expand All @@ -98,7 +96,7 @@ status() {
cd $APP_ROOT
check_pid
if [ "$PID" -ne 0 -a "$STATUS" -ne 0 ]; then
echo "$DESC / Puma with PID $PID is running."
echo "$DESC / Unicorn with PID $PID is running."
echo "$DESC / Sidekiq with PID $SPID is running."
else
echo "$DESC is not running."
Expand Down
138 changes: 0 additions & 138 deletions lib/support/init.d/gitlab_unicorn

This file was deleted.

3 comments on commit 7c55c73

@barryhatfield
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like some additional things in EE need to be changed to move back to Unicorn.

I redirected the init script to show this error:

/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/rubygems_integration.rb:214:in block in replace_gem': unicorn is not part of the bundle. Add it to Gemfile. (Gem::LoadError) from /home/git/gitlab/vendor/bundle/ruby/2.0.0/bin/unicorn_rails:22:in

'

bundle install in the gitlab dir does not install unicorn.

@nilebu
Copy link

@nilebu nilebu commented on 7c55c73 Aug 21, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get it.
Why you brought back unicorn by default when puma is faster and better, and the most important thing: it worked when unicorn is not (in this configuration) ?

Had to do git checkout 6ec73fc9a64938566d2e6d1a804990fa0f8849f0z to get back puma.

@Razer6
Copy link
Member

@Razer6 Razer6 commented on 7c55c73 Aug 21, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @dosire said: "Puma caused 100% CPU and greater memory leaks when running mult-ithreaded on systems with many concurrent users."

Please sign in to comment.