unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* FreeBSD rc script
@ 2009-12-07  8:51 John-Paul Bader
  2009-12-07  9:50 ` Eric Wong
  0 siblings, 1 reply; 2+ messages in thread
From: John-Paul Bader @ 2009-12-07  8:51 UTC (permalink / raw)
  To: unicorn list

Hey Eric,

would you be interested in including a FreeBSD rc.d script ? Here is what my current one looks like:

in /usr/local/etc/rc.d/unicorn 

#!/bin/sh
#
# PROVIDE: unicorn

. /etc/rc.subr

name=unicorn
rcvar=`set_rcvar`

command=/usr/local/bin/unicorn_rails
command_args="-c /usr/local/etc/unicorn.rb -E production -D"

load_rc_config ${name}

: ${unicorn_dir:=/usr/local/www/}

procname=ruby18

unicorn_chdir=${unicorn_dir}
required_dirs=${unicorn_dir}

extra_commands=reload
sig_reload=USR2

run_rc_command $1


and in /etc/rc.conf

unicorn_enable="YES"
unicorn_dir="/usr/local/www/myprojectroot"


This loads unicorn at startup, gives the usual start stop and restart commands and has a reload command which sends USR2 to the master process.

Kind regards, John
_______________________________________________
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] 2+ messages in thread

* Re: FreeBSD rc script
  2009-12-07  8:51 FreeBSD rc script John-Paul Bader
@ 2009-12-07  9:50 ` Eric Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2009-12-07  9:50 UTC (permalink / raw)
  To: unicorn list

John-Paul Bader <hukl@berlin.ccc.de> wrote:
> Hey Eric,
> 
> would you be interested in including a FreeBSD rc.d script ? Here is
> what my current one looks like:

Hi Paul,

Sure, a few comments below.

> command=/usr/local/bin/unicorn_rails
> command_args="-c /usr/local/etc/unicorn.rb -E production -D"

<snip>

> extra_commands=reload
> sig_reload=USR2

<snip>

> This loads unicorn at startup, gives the usual start stop and restart
> commands and has a reload command which sends USR2 to the master
> process.

Since it's using a Unicorn config file with USR2, wouldn't it have to
use QUIT to complete the actual upgrade?

Not too knowledgeable with FreeBSD init scripts on my end here,
but I'm guessing at how it'd work:

	extra_commands="reexec graceful reload"
	sig_reexec=USR2
	sig_graceful=QUIT
	sig_reload=HUP

	...

-- 
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] 2+ messages in thread

end of thread, other threads:[~2009-12-07  9:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-07  8:51 FreeBSD rc script John-Paul Bader
2009-12-07  9:50 ` 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).