Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 374855 - dev-db/mysql-5.1.56 checkconfig() can kill random process
Summary: dev-db/mysql-5.1.56 checkconfig() can kill random process
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-11 15:06 UTC by Marcin Mirosław
Modified: 2013-01-30 19:20 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcin Mirosław 2011-07-11 15:06:56 UTC
In init script there is:
checkconfig() {
[snip]
if [[ -f "${pidfile}" ]] ; then
   kill -15 $(< ${pidfile}) 2>/dev/null
[snip]

Let's imagine situation all server crashed, pid file remains in file system. OS starts, init scripts find existing pid file and kill random process. Who knows what process has this pid now?
Second situation, i've tried setup second instantion of mysql. I did mistake,  init scripts used my.conf instead my-new-extra.cnf and then check)config() killed my working instance of mysql.

Reproducible: Always
Comment 1 Francesco Riosa 2011-07-12 10:59:19 UTC
(In reply to comment #0)
> In init script there is:
> checkconfig() {
> [snip]
> if [[ -f "${pidfile}" ]] ; then
>    kill -15 $(< ${pidfile}) 2>/dev/null
> [snip]
> 
> Let's imagine situation all server crashed, pid file remains in file system. OS
> starts, init scripts find existing pid file and kill random process. Who knows
> what process has this pid now?

maybe it should be:
if [[ -f "${pidfile}" ]] && [[ "$(pgrep mysqld| grep ^$(<${pidfile})$)" != "" ]]; then

and maybe it's time to make dev-db/mysql-init-scripts-2.0 stable ;-)



> Second situation, i've tried setup second instantion of mysql. I did mistake, 
> init scripts used my.conf instead my-new-extra.cnf and then check)config()
> killed my working instance of mysql.
> 
> Reproducible: Always

If I've understud this correctly this one is not a bug
Comment 2 Marcin Mirosław 2011-07-12 13:10:36 UTC
Honestly i'm not sure init script should ever kill any proccess while is executing "start".

(In reply to comment #1)
> If I've understud this correctly this one is not a bug

This situation has led me to find this problem. And as i said in first sentence, executing "start" shouldn't kill any proccess.
Comment 3 Brian Evans (RETIRED) gentoo-dev 2012-08-15 17:52:25 UTC
checkconfig is gone with mysql-init-scripts-2.0_pre1-r2 which is stabled.
Also, it no longer kills running processes.

We can close this bug as fixed.
Comment 4 Marcin Mirosław 2012-08-16 07:58:50 UTC
Imho we should wait with closing bug til mysql-init-scripts-1.2 is in tree.
Comment 5 Brian Evans (RETIRED) gentoo-dev 2013-01-30 19:06:52 UTC
(In reply to comment #4)
> Imho we should wait with closing bug til mysql-init-scripts-1.2 is in tree.

If 2.0_pre1-r2 is stable on all arches, why should we "wait til 1.2 is in tree"?

This should be closed as fixed.
Comment 6 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2013-01-30 19:20:00 UTC
Closing