Bug 182025 - mysql logrotate script corner case
mysql logrotate script corner case
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: mysql (Show other bugs)
4
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tom Lane
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-02-19 04:20 EST by Dave Jones
Modified: 2015-01-04 17:25 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-05-17 21:35:26 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Dave Jones 2006-02-19 04:20:11 EST
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 04:24:09 EST
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 05:09:51 EST
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-17 21:35:26 EDT
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-17 21:46:41 EDT
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.