From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/767 Path: news.gmane.org!not-for-mail From: Charlie Brady Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: Warning about mysqld's behaviour Date: Thu, 14 Apr 2005 11:29:29 -0400 (EDT) Message-ID: References: <20050414085007.3830.qmail@b6398251b71d42.315fe32.mid.smarden.org> <20050414120750.GB21873@home.power> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Trace: sea.gmane.org 1113514648 22556 80.91.229.2 (14 Apr 2005 21:37:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 14 Apr 2005 21:37:28 +0000 (UTC) Cc: supervision@list.skarnet.org Original-X-From: supervision-return-1003-gcsg-supervision=m.gmane.org@list.skarnet.org Thu Apr 14 23:37:25 2005 Return-path: Original-Received: from antah.skarnet.org ([212.85.147.14]) by ciao.gmane.org with smtp (Exim 4.43) id 1DMC13-0001yf-BQ for gcsg-supervision@gmane.org; Thu, 14 Apr 2005 23:36:49 +0200 Original-Received: (qmail 13790 invoked by uid 76); 14 Apr 2005 21:40:37 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Archive: Original-Received: (qmail 13048 invoked from network); 14 Apr 2005 19:53:56 -0000 X-X-Sender: charlieb@e-smith.charlieb.ott.istop.com Original-To: Alex Efros In-Reply-To: <20050414120750.GB21873@home.power> Xref: news.gmane.org gmane.comp.sysutils.supervision.general:767 X-Report-Spam: http://spam.gmane.org/gmane.comp.sysutils.supervision.general:767 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 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