unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* Different behavior with pid files and SIGUSR2
@ 2014-01-28 19:49 Michael Graff
  2014-01-28 20:03 ` Eric Wong
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Graff @ 2014-01-28 19:49 UTC (permalink / raw)
  To: mongrel-unicorn

Previously, when I sent a SIGUSR2 to Unicorn, I generally saw this happen:

(1)  The PID file was renamed (or copied) to include .oldbin
(2)  The new instance started spinning up, and create a new .pid file.
(3)  At some point, the old instance would be told to shut down from my unicorn.rb file, once workers started.
(4)  The .oldbin would go away.

What I appear to be seeing now, with 4.7.0, is:

(1)  The PID file is removed.
(2)  The new instance spins up, but until it starts its first worker, no .pid file is created.

I don't mind the new behavior particularly, but it did surprise me a bit.  Is this new behavior working as intended?

--Michael

_______________________________________________
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

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

* Re: Different behavior with pid files and SIGUSR2
  2014-01-28 19:49 Different behavior with pid files and SIGUSR2 Michael Graff
@ 2014-01-28 20:03 ` Eric Wong
  2014-01-28 20:08   ` Michael Graff
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Wong @ 2014-01-28 20:03 UTC (permalink / raw)
  To: unicorn list; +Cc: Michael Graff

Michael Graff <explorer@flame.org> wrote:
> What I appear to be seeing now, with 4.7.0, is:
> 
> (1)  The PID file is removed.
> (2)  The new instance spins up, but until it starts its first worker, no .pid file is created.
> 
> I don't mind the new behavior particularly, but it did surprise me a bit.  Is this new behavior working as intended?

Yes in 4.7.0, but Jimmy convinced me to change it so the PID is written
early again in 4.8.0 (also pushing out 4.8.1 soon)

ref: http://mid.gmane.org/CAHStS5gFYcPBDxkVizAHrOeDKAkjT69kruFdgaY0CbB+vLbK8Q@mail.gmail.com
_______________________________________________
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

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

* Re: Different behavior with pid files and SIGUSR2
  2014-01-28 20:03 ` Eric Wong
@ 2014-01-28 20:08   ` Michael Graff
  2014-01-28 20:16     ` Eric Wong
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Graff @ 2014-01-28 20:08 UTC (permalink / raw)
  To: Eric Wong; +Cc: unicorn list

Good deal.  This was breaking my restart script in a non-obvious way.  Granted, my restart script should be smarter...

What is the preferred way to start-on-server-reboot and upgrade-in-place these days?  I have an older linux-expecting init.d-style script I've been using for years, so it's likely time to consider alternatives.

--Michael



On Jan 28, 2014, at 2:03 PM, Eric Wong <normalperson@yhbt.net> wrote:

> Michael Graff <explorer@flame.org> wrote:
>> What I appear to be seeing now, with 4.7.0, is:
>> 
>> (1)  The PID file is removed.
>> (2)  The new instance spins up, but until it starts its first worker, no .pid file is created.
>> 
>> I don't mind the new behavior particularly, but it did surprise me a bit.  Is this new behavior working as intended?
> 
> Yes in 4.7.0, but Jimmy convinced me to change it so the PID is written
> early again in 4.8.0 (also pushing out 4.8.1 soon)
> 
> ref: http://mid.gmane.org/CAHStS5gFYcPBDxkVizAHrOeDKAkjT69kruFdgaY0CbB+vLbK8Q@mail.gmail.com
> 

_______________________________________________
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

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

* Re: Different behavior with pid files and SIGUSR2
  2014-01-28 20:08   ` Michael Graff
@ 2014-01-28 20:16     ` Eric Wong
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Wong @ 2014-01-28 20:16 UTC (permalink / raw)
  To: Michael Graff; +Cc: unicorn list

Michael Graff <explorer@flame.org> wrote:
> Good deal.  This was breaking my restart script in a non-obvious way.
> Granted, my restart script should be smarter...

Sorry about that :x

> What is the preferred way to start-on-server-reboot and
> upgrade-in-place these days?  I have an older linux-expecting
> init.d-style script I've been using for years, so it's likely time to
> consider alternatives.

I still use an init script, it should work with all the modern inits.
Others somebody else has other suggestions (I think socket activation
with systemd should work by setting the UNICORN_FD env).

Maybe I should merge unicorn_forever:
  http://mid.gmane.org/20130724031151.GA14534@dcvr.yhbt.net
_______________________________________________
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

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

end of thread, other threads:[~2014-01-28 20:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-28 19:49 Different behavior with pid files and SIGUSR2 Michael Graff
2014-01-28 20:03 ` Eric Wong
2014-01-28 20:08   ` Michael Graff
2014-01-28 20:16     ` Eric Wong

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

	../../../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).