Can't Write to Log, Root Keeps Re-Owning Them

I’m having trouble with logging in a fresh install of 13.5.0. I’m running Asterisk as non-root, but for some reason when the log files rotate, the log files (specifically messages and queue_log) show up as owned by root. Asterisk ceases writing to them.

I’ve tried

That fixes the problem temporarily, but it comes back after a day or so when the log rotates.

Is there something I should change to make sure these are permanently owned by the asterisk user?

Just to add to my confusion, if I manually rotate logs from the Asterisk command line, “logger rotate” the new logs are owned by Asterisk. But if the logs rotate automatically, the new logs are owned by root.

Your problem lies in the logrotate script (which will be run as root.)

That helps immensely. I changed the line:


I’m optimistic this will solve the issue. Thank you!