Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 172870 - dev-db/mysql-init-scripts-1.2: logrotate fails if mysqld not running
Summary: dev-db/mysql-init-scripts-1.2: logrotate fails if mysqld not running
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High trivial (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
: 183134 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-03-31 12:22 UTC by Jaco Kroon
Modified: 2011-01-13 20:07 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Simple patch to avoid this error (mysql.patch,337 bytes, patch)
2009-01-25 14:05 UTC, Slamp
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jaco Kroon 2007-03-31 12:22:31 UTC
If one has mysql installed but not running then the default postrotate script in the logrotate description fails with:

cat: /var/run/mysqld/mysqld.pid: No such file or directory
Usage:
  kill pid ...              Send SIGTERM to every process listed.
  kill signal pid ...       Send a signal to every process listed.
  kill -s signal pid ...    Send a signal to every process listed.
  kill -l                   List all signal names.
  kill -L                   List all signal names in a nice table.
  kill -l signal            Convert between signal numbers and names.
error: error running shared postrotate script for /var/log/mysql/mysql.err /var/log/mysql/mysql.log /var/log/mysql/mysqld.err 

Whilst not 100 % foolproof the following alternative in postrotate will (with the exception of the pid file disappearing at extremely short notice) function correctly:

[ -r /var/run/mysqld/mysqld.pid ] && /bin/kill -HUP $(</var/run/mysqld/mysqld.pid)

Note that this does not cause problems, it's just annoying.

Reproducible: Always

Steps to Reproduce:
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-06-25 11:31:49 UTC
*** Bug 183134 has been marked as a duplicate of this bug. ***
Comment 2 Slamp 2009-01-25 14:05:36 UTC
Created attachment 179673 [details, diff]
Simple patch to avoid this error
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-01-13 20:07:31 UTC
Implemented in new mysql-init-scripts-2.0_pre1