Skip to content

[bug]: make install-logrotate causes logrotate to fail on service restart #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
InterLinked1 opened this issue May 18, 2023 · 0 comments · Fixed by #97
Closed
1 task done

[bug]: make install-logrotate causes logrotate to fail on service restart #96

InterLinked1 opened this issue May 18, 2023 · 0 comments · Fixed by #97
Assignees
Labels
bug support-level-core Functionality with core support level

Comments

@InterLinked1
Copy link
Contributor

Severity

Minor

Versions

20.1.0

Components/Modules

asterisk.logrotate

Operating Environment

Debian 11

Frequency of Occurrence

Constant

Issue Description

Imported from JIRA: https://issues.asterisk.org/jira/browse/ASTERISK-30442

Commit 55c53de 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 {

Relevant log output

No response

Asterisk Issue Guidelines

  • Yes, I have read the Asterisk Issue Guidelines
InterLinked1 added a commit to InterLinked1/asterisk that referenced this issue May 18, 2023
The Asterisk logrotate script contains explicit
references to files with the .log extension,
which are also included when *log is expanded.
This causes issues with newer versions of logrotate.
This fixes this by ensuring that a log file cannot
be referenced multiple times after expansion occurs.

Resolves: asterisk#96
ASTERISK-30442
Reported by: EN Barnett
Tested by: EN Barnett
@jcolp jcolp added support-level-core Functionality with core support level and removed triage labels May 18, 2023
gtjoseph pushed a commit that referenced this issue May 25, 2023
The Asterisk logrotate script contains explicit
references to files with the .log extension,
which are also included when *log is expanded.
This causes issues with newer versions of logrotate.
This fixes this by ensuring that a log file cannot
be referenced multiple times after expansion occurs.

Resolves: #96
ASTERISK-30442
Reported by: EN Barnett
Tested by: EN Barnett
asteriskteam pushed a commit that referenced this issue May 25, 2023
The Asterisk logrotate script contains explicit
references to files with the .log extension,
which are also included when *log is expanded.
This causes issues with newer versions of logrotate.
This fixes this by ensuring that a log file cannot
be referenced multiple times after expansion occurs.

Resolves: #96
ASTERISK-30442
Reported by: EN Barnett
Tested by: EN Barnett
asterisk-org-access-app bot pushed a commit that referenced this issue Jun 30, 2023
The Asterisk logrotate script contains explicit
references to files with the .log extension,
which are also included when *log is expanded.
This causes issues with newer versions of logrotate.
This fixes this by ensuring that a log file cannot
be referenced multiple times after expansion occurs.

Resolves: #96
ASTERISK-30442
Reported by: EN Barnett
Tested by: EN Barnett

(cherry picked from commit 22c9d52)
asterisk-org-access-app bot pushed a commit that referenced this issue Jul 10, 2023
The Asterisk logrotate script contains explicit
references to files with the .log extension,
which are also included when *log is expanded.
This causes issues with newer versions of logrotate.
This fixes this by ensuring that a log file cannot
be referenced multiple times after expansion occurs.

Resolves: #96
ASTERISK-30442
Reported by: EN Barnett
Tested by: EN Barnett

(cherry picked from commit 22c9d52)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug support-level-core Functionality with core support level
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants