Public bug reported:

[Description]

After the MR part of this bug report:
https://bugs.launchpad.net/ubuntu/+source/mysql-8.0/+bug/1850980

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.

** Affects: mysql-8.0 (Ubuntu)
     Importance: Undecided
         Status: New

** Affects: mysql-8.4 (Ubuntu)
     Importance: Undecided
     Assignee: Ghadi Rahme (ghadi-rahme)
         Status: New

** Affects: mysql-8.0 (Ubuntu Jammy)
     Importance: Undecided
     Assignee: Ghadi Rahme (ghadi-rahme)
         Status: New

** Affects: mysql-8.0 (Ubuntu Noble)
     Importance: Undecided
     Assignee: Ghadi Rahme (ghadi-rahme)
         Status: New

** Affects: mysql-8.4 (Ubuntu Plucky)
     Importance: Undecided
     Assignee: Ghadi Rahme (ghadi-rahme)
         Status: New

** Affects: mysql-8.4 (Ubuntu Questing)
     Importance: Undecided
     Assignee: Ghadi Rahme (ghadi-rahme)
         Status: New

** Also affects: mysql-8.0 (Ubuntu Questing)
   Importance: Undecided
       Status: New

** Also affects: mysql-8.0 (Ubuntu Jammy)
   Importance: Undecided
       Status: New

** Also affects: mysql-8.0 (Ubuntu Noble)
   Importance: Undecided
       Status: New

** Also affects: mysql-8.0 (Ubuntu Plucky)
   Importance: Undecided
       Status: New

** Also affects: mysql-8.4 (Ubuntu)
   Importance: Undecided
       Status: New

** 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: (unassigned) => Ghadi Rahme (ghadi-rahme)

** Changed in: mysql-8.0 (Ubuntu Noble)
     Assignee: (unassigned) => Ghadi Rahme (ghadi-rahme)

** Changed in: mysql-8.4 (Ubuntu Plucky)
     Assignee: (unassigned) => Ghadi Rahme (ghadi-rahme)

** Changed in: mysql-8.4 (Ubuntu Questing)
     Assignee: (unassigned) => Ghadi Rahme (ghadi-rahme)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2120936

Title:
  logrotate returns an error if mysql service is disabled

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mysql-8.0/+bug/2120936/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to