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. With the exception of TTIN/TTOU, signal handling matches the behavior of nginx so it should be possible to easily share process management scripts between Unicorn and nginx.
Sending signals directly to the worker processes should not normally be needed. If the master process is running, any exited worker will be automatically respawned.
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.
You may replace a running instance of unicorn with a new one without 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:
The procedure is exactly like that of nginx:
unicorn master (old)
\_ unicorn worker[0]
\_ unicorn worker[1]
\_ unicorn worker[2]
\_ unicorn worker[3]
\_ unicorn master
\_ unicorn worker[0]
\_ unicorn worker[1]
\_ unicorn worker[2]
\_ unicorn worker[3]
If something is broken, then send HUP to the old master to reload the config and restart its workers. Then send QUIT to the new master process.
Generated with the Darkfish Rdoc Generator 1.1.6.