Skip to content

Commit

Permalink
examples/logrotate.conf: update example for systemd
Browse files Browse the repository at this point in the history
...And add placeholders for other systems
  • Loading branch information
Eric Wong committed Jun 20, 2016
1 parent 40ac001 commit 87715a8
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion examples/logrotate.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down

0 comments on commit 87715a8

Please sign in to comment.