unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* SIGWINCH ignored...
@ 2015-05-19 14:02 Dan Moore
  2015-05-19 23:28 ` Eric Wong
       [not found] ` <861658785.98319.1432078146036.JavaMail.mobile-sync@ioii68>
  0 siblings, 2 replies; 4+ messages in thread
From: Dan Moore @ 2015-05-19 14:02 UTC (permalink / raw)
  To: unicorn-public

I’m interested in the SIGWINCH signal and specifically the message that is posted to the console at an INFO level instead of DEBUG level: https://github.com/ddollar/foreman/issues/557 “INFO – : SIGWINCH ignored because we’re not daemonized” I would like to request that this be moved to DEBUG level as it’s quite chatty when using tmux, foreman, and terminal. I apologize if this was already discussed, but I cannot seem to perform a full search on the email archives.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: SIGWINCH ignored...
  2015-05-19 14:02 SIGWINCH ignored Dan Moore
@ 2015-05-19 23:28 ` Eric Wong
       [not found] ` <861658785.98319.1432078146036.JavaMail.mobile-sync@ioii68>
  1 sibling, 0 replies; 4+ messages in thread
From: Eric Wong @ 2015-05-19 23:28 UTC (permalink / raw)
  To: Dan Moore; +Cc: unicorn-public

Don't send HTML parts, it is flagged as spam and nearly lost.

Onto your question...

Dan Moore <dan@vaporwa.re> wrote:
> I’m interested in the SIGWINCH signal and specifically the message
> that is posted to the console at an INFO level instead of DEBUG level:
> https://github.com/ddollar/foreman/issues/557
> “INFO – : SIGWINCH ignored because we’re not daemonized”

I wrote this patch a while ago to a private bug reporter (via
unicorn@bogomips.org) back in July 2013, but apparently it
was forgotten:

--- a/lib/unicorn/http_server.rb
+++ b/lib/unicorn/http_server.rb
@@ -294,13 +294,13 @@ class Unicorn::HttpServer
       when :USR2 # exec binary, stay alive in case something went wrong
         reexec
       when :WINCH
-        if Unicorn::Configurator::RACKUP[:daemonized]
+        if $stdin.tty?
+          logger.info "SIGWINCH ignored because we're not daemonized"
+        else
           respawn = false
           logger.info "gracefully stopping all workers"
           soft_kill_each_worker(:QUIT)
           self.worker_processes = 0
-        else
-          logger.info "SIGWINCH ignored because we're not daemonized"
         end
       when :TTIN
         respawn = true

I don't recall it breaks anything, so perhaps it's a good change to make
for unicorn 5.

> I would like to request that
> this be moved to DEBUG level as it’s quite chatty when using tmux,
> foreman, and terminal.

I don't think using DEBUG is a good idea to hack around a problem,
but rather detecting whether stdin is a TTY as above is a better check.

The archives are also mirrored to gmane.org and mail-archive.com,
so they should be searchable from either of those.

> I apologize if this was already discussed, but
> I cannot seem to perform a full search on the email archives.

The mailing list archives are cloneable via git:
  git clone --bare git://bogomips.org/unicorn-public/

And the tree layout is described at:
  http://ssoma.public-inbox.org/ssoma_repository.txt
  (it's not meant to be cloned without --bare)

You can currently use the ssoma command-line (at ssoma.public-inbox.org)
tool to import the archives into a mbox/maildir and search using tools
such as mairix/notmuch/etc...

The existing HTML archives at http://bogomips.org/unicorn-public/ should
be easily crawlable by search engines (no JS, frames, CSS or images),
but a Xapian-based search might happen in the future (that would also
help with maintaining stable IDs for read-only NNTP support).


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: SIGWINCH ignored...
       [not found] ` <861658785.98319.1432078146036.JavaMail.mobile-sync@ioii68>
@ 2015-05-20  1:02   ` Dan Moore
  2015-05-20 23:11     ` Eric Wong
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Moore @ 2015-05-20  1:02 UTC (permalink / raw)
  To: Eric Wong; +Cc: unicorn-public@bogomips.org

Thank you, that's perfect. +1 for unicorn 5 patch.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: SIGWINCH ignored...
  2015-05-20  1:02   ` Dan Moore
@ 2015-05-20 23:11     ` Eric Wong
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Wong @ 2015-05-20 23:11 UTC (permalink / raw)
  To: Dan Moore; +Cc: unicorn-public

Dan Moore <dan@vaporwa.re> wrote:
> Thank you, that's perfect. +1 for unicorn 5 patch.

Thanks for the confirmation, pushed as the following commit:

commit a6077391bb62d0b13016084b0eea36b987afe8f0
Author: Eric Wong <e@80x24.org>
Date:   Wed May 20 22:15:48 2015 +0000

    process SIGWINCH unless stdin is a TTY
    
    Some process managers such as foreman and daemontools rely on
    unicorn not daemonizing, but we still want to be able to process
    SIGWINCH in that case.
    
    stdout and stderr may be redirected to a pipe (for cronolog or
    similar process), so those are less likely to be attached to a TTY
    than stdin.  This also allows users to process SIGWINCH when running
    inside a regular terminal if they redirect stdin to /dev/null.
    
    Reported-by: Dan Moore <dan@vaporwa.re>
    References: <etPan.555b4293.5b47a5b7.e617@danbookpro>
    	<20150519232858.GA23515@dcvr.yhbt.net>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-05-20 23:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-19 14:02 SIGWINCH ignored Dan Moore
2015-05-19 23:28 ` Eric Wong
     [not found] ` <861658785.98319.1432078146036.JavaMail.mobile-sync@ioii68>
2015-05-20  1:02   ` Dan Moore
2015-05-20 23:11     ` Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).