Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 183134

Summary: mysql-init-scripts-1.2 does not check if mysql is running when logrotate postrotate is executed
Product: Gentoo Linux Reporter: Alexander Stoll <technoworx>
Component: [OLD] ServerAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Alexander Stoll 2007-06-25 11:19:28 UTC
The mysql specific include file for logrotate (/etc/logrotate.d/mysql) does not check for the existance of the pid file when the postrotate kill... is executed.
When mysql is not running, the logrotate cronjob executes the postrotate part and bails out for the not existent pid file, because there is no when mysql is not running. All following logrotate include files are not executed... :-(


Reproducible: Always

Steps to Reproduce:
1. have the logrotate include installes
2. stop mysql
3. execute logrotate and watch it bail out for the missing file

Actual Results:  
logrotate does not rotate for includes after mysql

Expected Results:  
check for existance of the pidfile before executing "kill...."

I fixed this for a single instance of mysql with a simple check:

if [ -f /var/run/mysqld/mysqld.pid ]; then \
    /bin/kill -HUP `cat /var/run/mysqld/mysqld.pid`
fi;

The logrotate include is not sufficient for multiple instances of mysql...
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-06-25 11:31:49 UTC

*** This bug has been marked as a duplicate of bug 172870 ***