Logrotate: error running shared postrotate script

Ok so, still no clue what is happening here and why no one else is having this issue. It seems that newly provisioned trellis servers on DO do not have the nginx rotate command so the post command of logrotate sends an error out.

This does not seem to cause any big errors as the server does start to use the new log files at some point anyway.

BUT, to fix, I went into /trellis/group_vars/all/logrotate.yml
and changed postrotate: service nginx rotate to postrotate: service nginx reload

This stops any cron error emails from being sent out and also seems to stop the usual cron rotate emails I have been receiving for years. I guess the rotate command has output and reload does not.

I’ll mark this as solved but would still love to know why this command has disappeared and no one else is receiving these error emails.

Thanks,
Josh

1 Like