logrotate returns an error if mysql service is disabled
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| mysql-8.0 (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
| Jammy |
Fix Released
|
Undecided
|
Ghadi Rahme | ||
| Noble |
Fix Released
|
Undecided
|
Ghadi Rahme | ||
| mysql-8.4 (Ubuntu) |
Fix Released
|
Undecided
|
Ghadi Rahme | ||
| Plucky |
Fix Released
|
Undecided
|
Ghadi Rahme | ||
| Questing |
Fix Released
|
Undecided
|
Ghadi Rahme | ||
Bug Description
[Description]
After the MR part of this bug report: https:/
logrotate returns an error when running the mysql log rotation script if the mysql service is disabled.
It is expected of logrotate not to return an error if the service is disabled since a disabled service will not generate logs to rotate anyways.
I have written a fix that checks first the status of the mysql service before running the rest of the log rotate script.
[Test Plan]
Run the following commands, and verify the output of logrotate:
$ sudo apt install mysql-server
$ sudo systemctl stop mysql.service
$ sudo logrotate -f /etc/logrotate.conf
If no error is returned by logrotate it means the fix was successful, else the following error is shown:
error: error running shared postrotate script for '/var/log/mysql.log /var/log/mysql/*log '
[Where problems could occur]
Since the changes is related to logs, possible issues may be that the script falsely detects that the mysql service is disabled and not rotate the logs.
Any problems resulting from this patch are expected to only be limited to log rotation.
| no longer affects: | mysql-8.4 (Ubuntu Jammy) |
| no longer affects: | mysql-8.4 (Ubuntu Noble) |
| no longer affects: | mysql-8.0 (Ubuntu Plucky) |
| no longer affects: | mysql-8.0 (Ubuntu Questing) |
| Changed in mysql-8.0 (Ubuntu Jammy): | |
| assignee: | nobody → Ghadi Rahme (ghadi-rahme) |
| Changed in mysql-8.0 (Ubuntu Noble): | |
| assignee: | nobody → Ghadi Rahme (ghadi-rahme) |
| Changed in mysql-8.4 (Ubuntu Plucky): | |
| assignee: | nobody → Ghadi Rahme (ghadi-rahme) |
| Changed in mysql-8.4 (Ubuntu Questing): | |
| assignee: | nobody → Ghadi Rahme (ghadi-rahme) |

questing debdiff