unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* Why "--pid" is deprecated?
@ 2009-12-24 13:36 Iñaki Baz Castillo
  2009-12-24 19:17 ` Eric Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Iñaki Baz Castillo @ 2009-12-24 13:36 UTC (permalink / raw)
  To: mongrel-unicorn

By inspecting bin/unicorn I've realized that "--pid" file exists but it's 
deprecated:

  opts.on("-P", "--pid FILE", "DEPRECATED") do |f|
    warn %q{Use of --pid/-P is strongly discouraged}
    warn %q{Use the 'pid' directive in the Unicorn config file instead}
    options[:pid] = f
  end

Could I know why? In order to build a service init script is really common the 
init script to handle the PID file so it can start, restart or stop the 
process runnining under that PID value.

Which is the real advantage of using "pid" directive in config file rather 
than "--pid"?

Thanks.

-- 
Iñaki Baz Castillo <ibc@aliax.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] 3+ messages in thread

* Re: Why "--pid" is deprecated?
  2009-12-24 13:36 Why "--pid" is deprecated? Iñaki Baz Castillo
@ 2009-12-24 19:17 ` Eric Wong
  2009-12-25 22:21   ` Iñaki Baz Castillo
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Wong @ 2009-12-24 19:17 UTC (permalink / raw)
  To: unicorn list

Iñaki Baz Castillo <ibc@aliax.net> wrote:
> By inspecting bin/unicorn I've realized that "--pid" file exists but it's 
> deprecated:
> 
>   opts.on("-P", "--pid FILE", "DEPRECATED") do |f|
>     warn %q{Use of --pid/-P is strongly discouraged}
>     warn %q{Use the 'pid' directive in the Unicorn config file instead}
>     options[:pid] = f
>   end
> 
> Could I know why? In order to build a service init script is really common the 
> init script to handle the PID file so it can start, restart or stop the 
> process runnining under that PID value.

Hi Iñaki,

It conflicts/confuses the -P/--path setting in bin/unicorn_rails.  An
oversight on my part since I based unicorn_rails on script/server
in Rails.  So I suppose we're stuck with it for a while.

> Which is the real advantage of using "pid" directive in config file rather 
> than "--pid"?

Not much, pid files suck either way.  Sadly there aren't many other
options that's universally used/accepted.

Using ENV["UNICORN_PID"] could be an option in the config file if you
want to share it between the config and init script.

-- 
Eric Wong
_______________________________________________
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] 3+ messages in thread

* Re: Why "--pid" is deprecated?
  2009-12-24 19:17 ` Eric Wong
@ 2009-12-25 22:21   ` Iñaki Baz Castillo
  0 siblings, 0 replies; 3+ messages in thread
From: Iñaki Baz Castillo @ 2009-12-25 22:21 UTC (permalink / raw)
  To: mongrel-unicorn

El Jueves, 24 de Diciembre de 2009, Eric Wong escribió:
> > Which is the real advantage of using "pid" directive in config file
> > rather  than "--pid"?
> 
> Not much, pid files suck either way.  Sadly there aren't many other
> options that's universally used/accepted.

Ubuntu upstart system (now also adopted by Debian) is a great improvement over 
classic init system as it behaves as a daemon which already knows the PID 
number used for each service (so it doesn't need to look for it in a file).
However I haven't experiment with upstart yet.


> Using ENV["UNICORN_PID"] could be an option in the config file if you
> want to share it between the config and init script.

The problem is that config file is usually a XML/INI/YAML/Ruby file, while a 
common init script is writen in Bash (99% of times), so reading a config 
parameter from the init script involves dirty parsing and so... :(

Well, I agree that using PID file is ugly and not cool at all, but it's widely 
used and it's what we have now :)




-- 
Iñaki Baz Castillo <ibc@aliax.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] 3+ messages in thread

end of thread, other threads:[~2009-12-25 22:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-24 13:36 Why "--pid" is deprecated? Iñaki Baz Castillo
2009-12-24 19:17 ` Eric Wong
2009-12-25 22:21   ` Iñaki Baz Castillo

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