Bug 182025 - mysql logrotate script corner case
Summary: mysql logrotate script corner case
Alias: None
Product: Fedora
Classification: Fedora
Component: mysql
Version: 4
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Tom Lane
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2006-02-19 09:20 UTC by Dave Jones
Modified: 2015-01-04 22:25 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2006-05-18 01:35:26 UTC
Type: ---

Attachments (Terms of Use)

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


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..


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


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


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 ...

Note You need to log in before you can comment on or make changes to this bug.