Summary:ASTERISK-30442: make install-logrotate causes logrotate to fail on service restart
Reporter:EN Barnett (encbar5)Labels:
Date Opened:2023-02-26 16:26:41.000-0600Date Closed:
Status:In Progress/In ProgressComponents:Contrib/General
Versions:20.1.0 Frequency of
Environment:Linux 5.10.0-21-amd64 Debian 11.6 Virtual Machine logrotate 3.18.0Attachments:
Description:Commit *55c53de022db2237723d57eb87305d709e4c808c* changed the first line of *contrib/scripts/asterisk.logrotate* to read
__LOGDIR__/debug.log __LOGDIR__/console __LOGDIR__/full.log __LOGDIR__/messages.log __LOGDIR__/*log {
Installing asterisk and running the service creates the file */var/log/asterisk/messages.log*.
Running {{make install-logrotate}} installs */etc/logrorate.d/asterisk* from the above template. Then running {{systemctl restart logrotate}} results in a failed service for logrotate. Manually calling logrotate from the command line reveals the error is
error: asterisk:1 duplicate log entry for /var/log/asterisk/messages.log
error: found error in file asterisk, skipping
The "\*log" in the first line of the logrotate config is expanding to messages.log, which now means that file is listed twice, and the configuration is bad. The obvious fix is to remove all explicit .log files and just allow the file globbing to take care of that.
__LOGDIR__/console __LOGDIR__/*.log {
I didn't list this as a patch because I'm new and haven't gone through all of the disclaimer stuff, but hopefully a dev can pick this up and include it as a fix.
Comments:By: Asterisk Team (asteriskteam) 2023-02-26 16:26:45.987-0600

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/].