Bug 54671

Summary: mysql-server fails to shut down
Product: [Retired] Red Hat Linux Reporter: Need Real Name <redhat>
Component: mysqlAssignee: Patrick Macdonald <patrickm>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: high Docs Contact:
Priority: medium    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-10-17 20:36:27 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 Need Real Name 2001-10-16 00:06:04 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)

Description of problem:
NOTE: this bug refers to "mysql-server" NOT to "mysql" but BUGZILLA DOES 
NOT OFFER THAT AS AN OPTION.

The bug: after changing the root password, the mysql-server fails to 
shutdown upon a system reboot.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. shutdown -r now
2.
3.
	

Actual Results:  mysqld fails to shut down

Expected Results:  mysqld should shut down

Additional info:

after installing the mysql-server RPM it is advisable to change the mysql-
root password.  this is standard procedure.  the problem is that having 
done so, /etc/init.d/mysqld now fails to shut the server down.  This is 
because the command: "/usr/bin/mysqladmin shutdown > /dev/null 2>&1" in 
the script needs to be modified to add the new root password.  Since IT IS 
HIGHLY UN-ADVISABLE to write the plaintext password for root here, it has 
been suggested in the mysql mailing list that a "shutdown" account be 
created with only shutdown permission and no password.  this account 
should then be used by the script to shut down the server.

a second possibility which I favour is to set the $HOME variable to /root 
in the script (right before the call to mysqladmin) such that the system 
admin can place a .my.cnf file there with his password since mysqladmin 
will use that.

Comment 1 Trond Eivind Glomsrxd 2001-10-17 16:00:44 UTC
Bugs are filed against SRPM, not binary rpm, so "mysql-server" isn't missing -
"mysql" is the correct component. As for how to fix the mysql brokenness
(process control should not be restricted by password, root can kill it anyway
and should thus be able to shut it down cleanly as well) I haven't decided yet.

Comment 2 Need Real Name 2001-10-17 20:16:49 UTC
> Bugs are filed against SRPM, not binary rpm, so "mysql-server" isn't missing -
> "mysql" is the correct component. 

ok, thx.

> As for how to fix the mysql brokenness (process control should not be 
> restricted by password, root can kill it anyway and should thus be able
> to shut it down cleanly as well) I haven't decided yet.

I'm not sure I understand what you mean by "process control should not be 
restricted by password"... if this means that the account used to shut the 
server down should not have a password, then I guess the first alternative is 
better... in fact, it really is a better alternative than the $HOME/.my.cnf 
solution I outlined since that still requires the user to do something for the 
server to shut down properly.

Comment 3 Trond Eivind Glomsrxd 2001-10-17 20:23:54 UTC
What I meant is that root should be able to do anything to a process without a
password. One likely solution is to just kill it instead of using mysqladmin -
not good, but mysql doesn't have something equivalent to pg_ctl. Root should be
able to use mysqladmin locally without password.

Comment 4 Need Real Name 2001-10-17 20:36:19 UTC
> One likely solution

yes, you could just replace the code in stop(), and announce the server's been 
shut down, letting the killall do it.  but I agree, no good.  if it were Sybase 
running it'd definitely be no good.

so the way to deal with it is with its own tools.  mysqldmin doesn't need a 
password if called with -u shutdown and that account has no password.  the good 
thing about this approach is it's easy for you to script in a way that doesn't 
need to be touched by the user later.

Comment 5 Trond Eivind Glomsrxd 2002-04-08 19:33:27 UTC
Fixed in newer versions (like 3.23.49-2), which uses kill to shut it down.