Debian’s asterisk package brings a /etc/logrotate.d/asterisk file which looks like:
/var/log/asterisk/debug /var/log/asterisk/messages /var/log/asterisk/full /var/log/asterisk/*_log {
weekly
missingok
rotate 4
sharedscripts
postrotate
/usr/sbin/invoke-rc.d asterisk logger-reload > /dev/null 2> /dev/null
endscript
}
My questions are about this postrotate section.
If I’m not mistake, this runs /etc/init.d/asterisk logger-reload.
Looking at /etc/init.d/asterisk on bullseye, I can’t read any logger-reload entry.
My questions are:
Are these postrotate script still required ?
In the ages of systemd and Asterisk 16 or later, which is the recommended postrotate script ?
I’ve not observed any harmful consequence from using this obsolete “/usr/sbin/invoke-rc.d asterisk logger-reload > /dev/null 2> /dev/null”. How can I explain this ?
If you don’t do an appropriate postrotate operation, Asterisk will continue to log to the old file (and even do so after it is removed from the directory).
Do Debian’s asterisk systemd settings include such logger-reload command ?
If negative, has this “/usr/sbin/invoke-rc.d asterisk logger-reload > /dev/null 2> /dev/null” any chance to work successfully ?
That would replace the whole of the logrotate configuration, so would not be appropriate as a post process script. If it were used as one you would probably want to suppress the output.