diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/logrotate.conf | 17 | ||||
-rw-r--r-- | examples/unicorn@.service | 5 |
2 files changed, 21 insertions, 1 deletions
diff --git a/examples/logrotate.conf b/examples/logrotate.conf index 03fefc6..437f6c6 100644 --- a/examples/logrotate.conf +++ b/examples/logrotate.conf @@ -3,6 +3,9 @@ # # See the logrotate(8) manpage for more information: # http://linux.die.net/man/8/logrotate +# +# public logrotate-related discussion in our archives: +# https://bogomips.org/unicorn-public/?q=logrotate # Modify the following glob to match the logfiles your app writes to: /var/log/unicorn_app/*.log { @@ -22,7 +25,19 @@ # config. Unicorn supports the USR1 signal and we send it # as our "lastaction" action: lastaction - # assuming your pid file is in /var/run/unicorn_app/pid + # For systemd users, assuming you use two services + # (as recommended) to allow zero-downtime upgrades. + # Only one service needs to be started, but signaling + # both here is harmless as long as they're both enabled + systemctl kill -s SIGUSR1 unicorn@1.service + systemctl kill -s SIGUSR1 unicorn@2.service + + # Examples for other process management systems appreciated + # Mail us at unicorn-public@bogomips.org + # (see above for archives) + + # If you use a pid file and assuming your pid file + # is in /var/run/unicorn_app/pid pid=/var/run/unicorn_app/pid test -s $pid && kill -USR1 "$(cat $pid)" endscript diff --git a/examples/unicorn@.service b/examples/unicorn@.service index 56aaec8..d95eb83 100644 --- a/examples/unicorn@.service +++ b/examples/unicorn@.service @@ -24,5 +24,10 @@ ExecReload = /bin/kill -HUP $MAINPID # adding a few seconds for scheduling differences: TimeoutStopSec = 62 +# Only kill the master process, it may be harmful to signal +# workers via default "control-group" setting since some +# Ruby extensions and applications misbehave on interrupts +KillMode = process + [Install] WantedBy = multi-user.target |