AFAICS the redhat scripts send a term, wait 10 secs then send a kill to the mysql processes ending with the parent process.

From what you guys are saying this is not the right way to stop mysql? If it isn't then someone should probably mention it to Redhat :)


Rehan


-----Original Message-----
From: Mike Buland [mailto:mike@geekgene.com]
Sent: 13 January 2008 19:01
To: supervision@list.skarnet.org
Subject: Re: using runit as init


Hey, a complicated program they made is better than one I have to manage.

If you do read the docs, they don't handle signals in mysqld, like I say,
mysqlmanager does.  They don't defend it, but they do explain that the only
way to safely shutdown mysql is to send it a command via the named socket. 
Since this can't be done easily from the commandline without a password,
unless you configrue mysql to accept the command from root without a
password, then this seems like a pretty decent solution, since this program
basically supervises it's child mysql processes and sends them a safe
shutdown signal when the mysqlmanager program receives a term signal.

All the scripts I've read from debian and redhat just send a kill...although
this seems alright most of the time (and they are official scripts), that
doesn't gurantee that data is flushed to disk, if mysql is in the middle of a
large operation, that data is gone.  This solution does solve that problem,
and keep runit from waiting for mysql to TERM.

--Mike

On Sunday 13 January 2008 11:39:56 am Charlie Brady wrote:
> On Sun, 13 Jan 2008, Mike Buland wrote:
> > On Sunday 13 January 2008 08:36:31 am Charlie Brady wrote:
> >> On Sat, 12 Jan 2008, Vincent Danen wrote:
> >>> mysqld is no more complex than anything else.
> >>
> >> Have they fixed it then, so that the master process kills children
> >> before dying?
> >
> > Yes, read the (very lame) docs on mysqlmanager.  It also now responds to
> > other signals (such as term) so it plays nicely with runit :)
>
> This might actually mean "no". They haven't fixed the signal
> handling in mysqld, but have instead introduced a new complicated program
> to try to work around the issues.
>
> > mysqlmanager was introduced sometime in mysql 5, not sure when.
>
> Introduced in 5.0.3. Not used by default since 5.0.4.