Bug 182025

Summary: mysql logrotate script corner case
Product: [Fedora] Fedora Reporter: Dave Jones <davej>
Component: mysqlAssignee: Tom Lane <tgl>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 4CC: byte, hhorak, pfrields
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-05-18 01:35:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dave Jones 2006-02-19 09:20:11 UTC
Subject: Cron <root@firewall> run-parts /etc/cron.daily

/etc/cron.daily/logrotate:

usage: kill [ -s signal | -p ] [ -a ] pid ...
       kill -l [ signal ]
usage: kill [ -s signal | -p ] [ -a ] pid ...
       kill -l [ signal ]

/etc/cron.daily/logrotate looks sane..

#!/bin/sh

/usr/sbin/logrotate /etc/logrotate.conf
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
    /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
fi
exit 0

logrotate-3.7.1-10

Comment 1 Ignacio Vazquez-Abrams 2006-02-19 09:24:09 UTC
This might be a problem with one of the entries in /etc/logrotate.d/conf or one
of the called scripts.

Comment 2 Dave Jones 2006-02-19 10:09:51 UTC
indeed. it's mysql.

(05:10:16:davej@firewall:logrotate.d)$ grep kill *
mysqld: [ -e /var/lock/subsys/mysqld ] && /bin/kill -HUP `cat /var/run/mysqld/my
sqld.pid  2> /dev/null ` || /bin/true
mysqld: [ -e /var/lock/subsys/mysqld ] && /bin/kill -HUP `cat /var/run/mysqld/my
sqld.pid  2> /dev/null ` || /bin/true

(05:10:31:davej@firewall:logrotate.d)$ [ -e /var/lock/subsys/mysqld ] &&
/bin/kill -HUP `cat /var/run/mysqld/mysqld.pid  2> /dev/null ` || /bin/true
usage: kill [ -s signal | -p ] [ -a ] pid ...
       kill -l [ signal ]

Somehow I ended up with a /var/lock/subsys/mysqld, but no /var/run/mysqld/mysqld.pid


ahh.. 

Feb 14 14:34:17 firewall kernel: [17700018.240000] Out of Memory: Killed process
2056 (mysqld).

not good.  (That was actually a side-effect of tethereal going nuts and leaking
memory -- another bug already filed on that one)

This is an abnormal situation, but the mysql logrotate script should check for
the existence of the pid file before feeding it to kill.


Comment 3 Tom Lane 2006-05-18 01:35:26 UTC
On further review, that logrotate script is unfixably broken anyway; mysqld is simply not designed in a way 
that allows its stdout/stderr output to be rotated (see also bug #786300).  Conclusion is to just remove it, 
which is now done.

Comment 4 Tom Lane 2006-05-18 01:46:41 UTC
I'm sorry, the above reference should be to bug #180639 ... got my bz and it numbers confused ...