From: Charlie Brady <charlieb@budge.apana.org.au>
Cc: supervision@list.skarnet.org
Subject: Re: Warning about mysqld's behaviour
Date: Thu, 14 Apr 2005 11:29:29 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.61.0504141035210.31619@e-smith.charlieb.ott.istop.com> (raw)
In-Reply-To: <20050414120750.GB21873@home.power>
On Thu, 14 Apr 2005, Alex Efros wrote:
> I use this ./run with MySQL 4.0.x. It allow me control mysql using runsvctrl:
> ---cut---
> #!/bin/bash
> exec </dev/null >/dev/null 2>/dev/null
> SHUTPASS="HERE_IS_ME_PASSWORD"
> trap "mysqladmin -u shutdown -p$SHUTPASS shutdown" 0
> trap 'exit 2' 1 2 3 15
> mysqld_safe --default-character-set=koi8_ru & wait
The reason that I use runsvctrl is that I believe that (with runit) I can
provide a better "mysqld_safe" than the mysql packagers can. Or, to put it
another way, mysqld_safe (called safe_mysqld in mysql-3) is just an
attempt to do in a shell script (most of) what runit already does more
simply and reliably.
One thing that safe_mysqld does which a runit run script won't do is
attempt to detect hung processes and then send them a -9 signal - but I
think that's a very suspect thing to do.
Since safe_mysqld depends on pid files and parsing the oputput of the ps
command, I'm sure that it's full of potential race conditions.
> ---cut---
> (I've special user "shutdown" with only permission to shutdown server
> because I dislike use "root" user and put it password in this script.)
>
> I've switched from sending TERM to mysqld to using "mysqladmin shutdown"
> some time ago because on very busy server sending TERM sometimes result
> in damaging database. There was number of cases when after reboot with
> "init 6" I found database crashed. :(
safe_mysqld starts mysqld with --skip-locking - perhaps that contributed
to your database corruption.
I prefer to follow Einstein's directive - make it as simple as possible -
but no simpler.
---
Charlie
next prev parent reply other threads:[~2005-04-14 15:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-11 3:16 Charlie Brady
2005-04-14 8:53 ` Gerrit Pape
2005-04-14 12:07 ` Alex Efros
2005-04-14 15:29 ` Charlie Brady [this message]
2005-04-14 18:05 ` Vincent Danen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.61.0504141035210.31619@e-smith.charlieb.ott.istop.com \
--to=charlieb@budge.apana.org.au \
--cc=supervision@list.skarnet.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).