O problema estava vindo do logrotate.
Basicamente, com minha configuração, executando unicórnio, não preciso usar a diretiva copytruncate
. (que é o que causa problemas aqui)
USR1 - Reopen all logs owned by the worker process. See Unicorn::Util.reopen_logs for what is considered a log. Log files are not reopened until it is done processing the current request, so multiple log lines for one request (as done by Rails) will not be split across multiple logs.
Isso começou a funcionar corretamente após a atualização para esta configuração:
/home/user/my_app/shared/log/*.log {
daily
missingok
dateext
rotate 30
compress
notifempty
extension gz
create 640 user user
sharedscripts
post-rotate
# Telling Unicorn to reload files
test -s /home/user/my_app/shared/pids/unicorn.pid && kill -USR1 "$(cat /home/user/my_app/shared/pids/unicorn.pid)"
# Reloading rsyslog telling it that files have been rotated
reload rsyslog 2>&1 || true
endscript
}