Skip to content

Commit

Permalink
update signals and command line documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nevans committed Jun 27, 2012
1 parent 90b7006 commit 774c2f0
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 11 deletions.
11 changes: 7 additions & 4 deletions README.md
Expand Up @@ -114,10 +114,13 @@ SIGNALS
The pool manager responds to the following signals:

* `HUP` - reload the config file, reload logfiles, restart all workers.
* `QUIT` - send `QUIT` to each worker parent and shutdown the manager after all workers are done.
* `INT` - send `QUIT` to each worker parent and immediately shutdown manager
* `TERM` - send `TERM` to each worker parent and immediately shutdown manager
* `WINCH` - send `QUIT` to each worker, but keep manager running (send `HUP` to reload config and restart workers)
* `QUIT` - gracefully shut down workers (via `QUIT`) and shutdown the manager
after all workers are done.
* `INT` - gracefully shut down workers (via `QUIT`) and immediately shutdown manager
* `TERM` - immediately shut down workers (via `INT`) and immediately shutdown manager
_(configurable via command line options)_
* `WINCH` - _(only when running as a daemon)_ send `QUIT` to each worker, but
keep manager running (send `HUP` to reload config and restart workers)
* `USR1`/`USR2`/`CONT` - pass the signal on to all worker parents (see Resque docs).

Use `HUP` to help logrotate run smoothly and to change the number of workers
Expand Down
15 changes: 12 additions & 3 deletions man/resque-pool.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "RESQUE\-POOL" "1" "May 2012" "RESQUE-POOL 0.3.0.DEV" "RESQUE-POOL"
.TH "RESQUE\-POOL" "1" "June 2012" "RESQUE-POOL 0.4.0.DEV" "RESQUE-POOL"
.
.SH "NAME"
\fBresque\-pool\fR \- resque worker pool management
Expand All @@ -21,6 +21,9 @@ When resque\-pool(1) is daemonized the \fBstdout\fR and \fBstderr\fR output stre
\fB\-c, \-\-config\fR \fIfile\fR: Uses the configuration specified in the \fIfile\fR provided instead of searching in the current and \fBconfig\fR directories for \fBresque\-pool\.yml\fR\.
.
.IP "\(bu" 4
\fB\-a, \-\-appname\fR \fIname\fR: Specifies the app name to be used for logging and procline\. If not specified, this defaults to the current working directory\.
.
.IP "\(bu" 4
\fB\-d, \-\-daemon\fR: Runs \fBresque\-pool\fR in the background as a daemon process\. This will redirect \fBstdout\fR and \fBstderr\fR to log files and write a PID file\.
.
.IP "\(bu" 4
Expand All @@ -30,7 +33,7 @@ When resque\-pool(1) is daemonized the \fBstdout\fR and \fBstderr\fR output stre
\fB\-e, \-\-stderr\fR \fIfile\fR: Writes the standard error output to \fIfile\fR instead of printing to the terminal\. When running as a daemon this defaults to the path \fBlog/resque\-pool\.stderr\.log\fR\.
.
.IP "\(bu" 4
\fB\-\-nosync\fR Allows writes to \fBstdout\fR and \fBstderr\fR to be buffered by the OS\.
\fB\-\-nosync\fR Allows writes to \fBstdout\fR and \fBstderr\fR to be buffered\.
.
.IP "\(bu" 4
\fB\-p, \-\-pidfile\fR \fIfile\fR: Writes the PID to the \fIfile\fR\. When running as a daemon this defaults to \fBtmp/pids/resque\-pool\.pid\fR\.
Expand All @@ -39,7 +42,13 @@ When resque\-pool(1) is daemonized the \fBstdout\fR and \fBstderr\fR output stre
\fB\-E, \-\-environment\fR \fIname\fR: Specifies the environment \fIname\fR to be set for \fBRAILS_ENV\fR, \fBRACK_ENV\fR and \fBRESQUE_ENV\fR which will be passed on to the pooled resque workers\.
.
.IP "\(bu" 4
\fB\-a, \-\-appname\fR \fIname\fR: Specifies the app name to be used for logging and procline\. If not specified, this defaults to the current working directory\.
\fB\-\-term\-graceful\-wait\fR: Configure TERM signal handling so the master will gracefully request worker shut downs (via \fBQUIT\fR) and wait for the workers to quit before shutting down itself\. This is the same behavior as the \fBQUIT\fR signal\.
.
.IP "\(bu" 4
\fB\-\-term\-graceful\fR: Configure TERM signal handling so the master will gracefully request worker shut downs (via \fBQUIT\fR) but shut itself down immediately\. This the same behavior as the \fBINT\fR signal\.
.
.IP "\(bu" 4
\fB\-\-term\-immediate\fR: Configure TERM signal handling so the master will request imediate worker shut downs (via \fBINT\fR) and shut itself down immediately\. This is the default \fBTERM\fR signal behavior\.
.
.IP "" 0
.
Expand Down
23 changes: 19 additions & 4 deletions man/resque-pool.1.ronn
Expand Up @@ -20,6 +20,10 @@ directory.
Uses the configuration specified in the <file> provided instead of
searching in the current and `config` directories for `resque-pool.yml`.

* `-a, --appname` <name>:
Specifies the app name to be used for logging and procline. If not
specified, this defaults to the current working directory.

* `-d, --daemon`:
Runs `resque-pool` in the background as a daemon process. This will
redirect `stdout` and `stderr` to log files and write a PID file.
Expand All @@ -35,7 +39,7 @@ directory.
`log/resque-pool.stderr.log`.

* `--nosync`
Allows writes to `stdout` and `stderr` to be buffered by the OS.
Allows writes to `stdout` and `stderr` to be buffered.

* `-p, --pidfile` <file>:
Writes the PID to the <file>. When running as a daemon this defaults
Expand All @@ -45,9 +49,20 @@ directory.
Specifies the environment <name> to be set for `RAILS_ENV`, `RACK_ENV`
and `RESQUE_ENV` which will be passed on to the pooled resque workers.

* `-a, --appname` <name>:
Specifies the app name to be used for logging and procline. If not
specified, this defaults to the current working directory.
* `--term-graceful-wait`:
Configure TERM signal handling so the master will gracefully request worker
shut downs (via `QUIT`) and wait for the workers to quit before shutting
down itself. This is the same behavior as the `QUIT` signal.

* `--term-graceful`:
Configure TERM signal handling so the master will gracefully request worker
shut downs (via `QUIT`) but shut itself down immediately. This the same
behavior as the `INT` signal.

* `--term-immediate`:
Configure TERM signal handling so the master will request imediate worker
shut downs (via `INT`) and shut itself down immediately. This is the
default `TERM` signal behavior.

## HISTORY

Expand Down

0 comments on commit 774c2f0

Please sign in to comment.