From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/764 Path: news.gmane.org!not-for-mail From: Gerrit Pape Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: Warning about mysqld's behaviour Date: Thu, 14 Apr 2005 08:53:06 +0000 Message-ID: <20050414085007.3830.qmail@b6398251b71d42.315fe32.mid.smarden.org> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1113468413 21073 80.91.229.2 (14 Apr 2005 08:46:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 14 Apr 2005 08:46:53 +0000 (UTC) Original-X-From: supervision-return-1000-gcsg-supervision=m.gmane.org@list.skarnet.org Thu Apr 14 10:46:48 2005 Return-path: Original-Received: from antah.skarnet.org ([212.85.147.14]) by ciao.gmane.org with smtp (Exim 4.43) id 1DLzzV-0000pP-BY for gcsg-supervision@gmane.org; Thu, 14 Apr 2005 10:46:25 +0200 Original-Received: (qmail 7294 invoked by uid 76); 14 Apr 2005 08:50:08 -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 7289 invoked from network); 14 Apr 2005 08:50:08 -0000 Original-To: supervision@list.skarnet.org Mail-Followup-To: supervision@list.skarnet.org Content-Disposition: inline In-Reply-To: Xref: news.gmane.org gmane.comp.sysutils.supervision.general:764 X-Report-Spam: http://spam.gmane.org/gmane.comp.sysutils.supervision.general:764 On Sun, Apr 10, 2005 at 11:16:06PM -0400, Charlie Brady wrote: > Version of mysql is 3.23.58. I haven't looked at other versions, so don't > know whether this is new or old brain-damage. > > I have a straightforward run file: > > #!/bin/sh > exec /usr/libexec/mysqld \ > --defaults-file=/etc/my.cnf \ > --basedir=/usr \ > --datadir=/var/lib/mysql \ > --user=mysql \ > --pid-file=/var/run/mysqld/mysqld.pid > > This starts a set of four mysqld processes/threads: > But notice that the pid file doesn't reference the parent process: > > sh-2.05a# svstat . > .: up (pid 31796) 123 seconds, normally down > sh-2.05a# cat /var/run/mysqld/mysqld.pid ; echo > 31798 > sh-2.05a# > But, it's worse than that, Jim! The parent process - the one that > supervise is watching and "controlling" ignores INT, TERM and QUIT > signals. > So we lose control of the daemon: > Fortunately runit provides an easy solution to this problem (although we > are left with no option but to trust a pid file, with all the problems > that entails). We just create control/t and control/d files (at least), > containing: > > #! /bin/sh > exec kill -TERM $(cat /var/run/mysqld/mysqld.pid) > [Gerrit, if you can verify this, you'll need to update your run script > list.] I personally don't use mysql, I won't verify it. I think instead of updating the run script on the web page, I'll remove mysql completely from the list. This service daemon causes so many troubles for a supervisor, that's not worth it imho, it even seems to change behavior from version to version. Thanks, Gerrit.