diff options
Diffstat (limited to 'SIGNALS')
-rw-r--r-- | SIGNALS | 25 |
1 files changed, 19 insertions, 6 deletions
@@ -1,12 +1,20 @@ == Signal handling In general, signals need only be sent to the master process. However, -the signals unicorn uses internally to communicate with the worker -processes are documented here as well. +the signals Unicorn uses internally to communicate with the worker +processes are documented here as well. With the exception of TTIN/TTOU, +signal handling matches the behavior of {nginx}[http://nginx.net/] so it +should be possible to easily share process management scripts between +Unicorn and nginx. === Master Process -* HUP - reload config file, app, and gracefully restart all workers +* HUP - reloads config file and gracefully restart all workers. + If the "preload_app" directive is false (the default), then workers + will also pick up any application code changes when restarted. If + "preload_app" is true, then application code changes will have no + effect; USR2 + QUIT (see below) must be used to load newer code in + this case. * INT/TERM - quick shutdown, kills all workers immediately @@ -47,6 +55,13 @@ automatically respawned. the current request, so multiple log lines for one request (as done by Rails) will not be split across multiple logs. + It is NOT recommended to send the USR1 signal directly to workers via + "killall -USR1 unicorn" if you are using user/group-switching support + in your workers. You will encounter incorrect file permissions and + workers will need to be respawned. Sending USR1 to the master process + first will ensure logs have the correct permissions before the master + forwards the USR1 signal to workers. + === Procedure to replace a running unicorn executable You may replace a running instance of unicorn with a new one without @@ -54,9 +69,7 @@ losing any incoming connections. Doing so will reload all of your application code, Unicorn config, Ruby executable, and all libraries. The only things that will not change (due to OS limitations) are: -1. The listener backlog size of already-bound sockets - -2. The path to the unicorn executable script. If you want to change to +1. The path to the unicorn executable script. If you want to change to a different installation of Ruby, you can modify the shebang line to point to your alternative interpreter. |