From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS33070 50.56.128.0/17 X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,T_DKIM_INVALID shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: archivist@yhbt.net Delivered-To: archivist@dcvr.yhbt.net Received: from rubyforge.org (50-56-192-79.static.cloud-ips.com [50.56.192.79]) by dcvr.yhbt.net (Postfix) with ESMTP id CD4FF1F43C for ; Mon, 25 Jun 2012 21:27:26 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 22EEE2E069; Mon, 25 Jun 2012 21:27:26 +0000 (UTC) X-Original-To: mongrel-unicorn@rubyforge.org Delivered-To: mongrel-unicorn@rubyforge.org Received: from mail-we0-f178.google.com (mail-we0-f178.google.com [74.125.82.178]) by rubyforge.org (Postfix) with ESMTP id A384E2E062 for ; Mon, 25 Jun 2012 21:27:18 +0000 (UTC) Received: by werf13 with SMTP id f13so3722295wer.23 for ; Mon, 25 Jun 2012 14:27:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=Rw9rTKB53AHnZgF27OU/3oO/CkatGpFQA/jUqs5isRI=; b=VsTG98n+9DlRzJQcJbRqB185/mzEGg8UlKD36TQvRVg5iyh77HjFTwfnCPO23Dmla6 2fsrD+QlCVNdQrApd0wC+9gzEgbY9f9tffWFjW0FI8m2MlnCkIj8DbUqKz7hZUlPvbh+ YH6WHKl/0fUQvH09b2PyV35NCqI7vcIEMtN4Ee4e351kxv+7ikozDyFU5+jGmO11caI1 3KTB83URdem/2YXzrrSC833/bDYMk0nHNiUCV2BXdC2WpQuJDcKEJiW//t3d2flcQSgW YM2xSr6TJKGM5zEejH78BLJgbnMGfH5RPPf20R7WFL7u9tAkI5mMWRDPGM5JwPdhiSA2 PJww== Received: by 10.180.81.65 with SMTP id y1mr27287150wix.1.1340658212193; Mon, 25 Jun 2012 14:03:32 -0700 (PDT) Received: from [192.168.2.106] ([92.57.172.190]) by mx.google.com with ESMTPS id fw4sm97580wib.0.2012.06.25.14.03.30 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 25 Jun 2012 14:03:31 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1278) Subject: Re: Address already in use From: Manuel Palenciano Guerrero In-Reply-To: <20120625202813.GA24617@dcvr.yhbt.net> Date: Mon, 25 Jun 2012 23:03:28 +0200 Message-Id: References: <0B72D3D4-CB04-47F2-B188-CAFDF41B8B1F@gmail.com> <20120625202813.GA24617@dcvr.yhbt.net> To: unicorn list X-Mailer: Apple Mail (2.1278) X-BeenThere: mongrel-unicorn@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: mongrel-unicorn-bounces@rubyforge.org Errors-To: mongrel-unicorn-bounces@rubyforge.org Hi, First, thanks Eric, J=E9r=E9my and Aaron for replying. I really appreciate = it. Yes Eric, I can see the line... "inherited addr=3D/tmp/unicorn.app.sock fd= =3D..." here is the full log ------------------------------------------------- I, [2012-06-21T11:40:44.282224 #29212] INFO -- : inherited addr=3D/tmp/uni= corn.sublimma_staging.sock fd=3D3 I, [2012-06-21T11:40:44.282480 #29212] INFO -- : Refreshing Gem list master process ready worker=3D0 ready worker=3D1 ready reaped # worker=3D0 reaped # worker=3D1 master complete E, [2012-06-21T11:40:46.386486 #29401] ERROR -- : adding listener failed ad= dr=3D/tmp/unicorn.sublimma_staging.sock (in use) E, [2012-06-21T11:40:46.386669 #29401] ERROR -- : retrying in 0.5 seconds (= 4 tries left) E, [2012-06-21T11:40:46.887724 #29401] ERROR -- : adding listener failed ad= dr=3D/tmp/unicorn.sublimma_staging.sock (in use) E, [2012-06-21T11:40:46.887832 #29401] ERROR -- : retrying in 0.5 seconds (= 3 tries left) E, [2012-06-21T11:40:47.388813 #29401] ERROR -- : adding listener failed ad= dr=3D/tmp/unicorn.sublimma_staging.sock (in use) E, [2012-06-21T11:40:47.388894 #29401] ERROR -- : retrying in 0.5 seconds (= 2 tries left) E, [2012-06-21T11:40:47.889878 #29401] ERROR -- : adding listener failed ad= dr=3D/tmp/unicorn.sublimma_staging.sock (in use) E, [2012-06-21T11:40:47.889957 #29401] ERROR -- : retrying in 0.5 seconds (= 1 tries left) E, [2012-06-21T11:40:48.390939 #29401] ERROR -- : adding listener failed ad= dr=3D/tmp/unicorn.sublimma_staging.sock (in use) E, [2012-06-21T11:40:48.391020 #29401] ERROR -- : retrying in 0.5 seconds (= 0 tries left) E, [2012-06-21T11:40:48.892002 #29401] ERROR -- : adding listener failed ad= dr=3D/tmp/unicorn.sublimma_staging.sock (in use) /var/www/sublimma/staging/shared/bundle/ruby/1.8/gems/unicorn-4.3.0/lib/uni= corn/socket_helper.rb:140:in `initialize': Address already in use - /tmp/un= icorn.sublimma_staging.sock (Errno::EADDRINUSE) ------------------------------------------------- my unicorn.rb: https://gist.github.com/2991110 and my production_init.sh: http://unicorn.bogomips.org/examples/init.sh I was planning on trying the following... adding the killing of the old_pid to the before_fork(), as in... old_pid =3D RAILS_ROOT + '/tmp/pids/unicorn.pid.oldbin' if File.exists?(old_pid) && server.pid !=3D old_pid begin Process.kill("QUIT", File.read(old_pid).to_i) rescue Errno::ENOENT, Errno::ESRCH # someone else did our job for us end end and making the UPGRADE case in the "init.sh" to just... -------------------------------------------------- upgrade) sig USR2 && echo "Upgraded" && exit 0 echo >&2 "Couldn't upgrade, starting '$CMD' instead" $CMD ;; -------------------------------------------------- Regards and thanks again ! Manuel P. On Jun 25, 2012, at 10:28 PM, Eric Wong wrote: > Manuel Palenciano Guerrero wrote: >> Hello there, >> = >> I seem to have a problem with unix-sockets, and cannot see many people w= ith the same situation when googling. >> = >> The problem is when upgrading (USR2 + QUIT) our applications. I get the = following error very frequently but not always. >> = >> E, [2012-06-21T11:40:46.386486 #29401] ERROR -- : adding listener failed= addr=3D/tmp/unicorn.app.sock (in use) > = > You should've seen an INFO message saying something like: > = > inherited addr=3D/tmp/unicorn.app.sock fd=3D... > = > in your logs. > = > Can you share your unicorn config? Are you using a before_exec hook > at all and could that hook be clobbering ENV["UNICORN_FD"]? > _______________________________________________ > Unicorn mailing list - mongrel-unicorn@rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-unicorn > Do not quote signatures (like this one) or top post when replying _______________________________________________ Unicorn mailing list - mongrel-unicorn@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-unicorn Do not quote signatures (like this one) or top post when replying