Re: Daemontool-izing MySQL

Brian Reichert <[email protected]>
Newsgroups gmane.comp.djb.syslog
Message-ID <[email protected]>
On Wed, Aug 20, 2003 at 08:18:39PM +0400, Dmitry Volkoff wrote:
> Are you sure you can restart or shutdown mysqld on linux with 
> Linuxthreads just executing `svc -t mysqld` or `svc -d mysqld` without 
> mysqladmin or some other program?

I don't know, as I don't use Linux; I use FreeBSD.

- assuming 'mysqld' is the name of the service, `svc -t mysqld`
  will send a SIGTERM to the mysqld process.

  According to:

    <http://www.mysql.com/doc/en/News-3.22.11.html>

  "MySQL now uses SIGTERM instead of SIGQUIT with shutdown to work
  better on FreeBSD."

  and

    <http://www.mysql.com/doc/en/News-4.0.3.html>

  "Fixed shutdown problem (SIGTERM signal handling) on Solaris.
  (Bug from 4.0.2)."

- peruse the contents of sql/mysqld.cc:

    static void init_signals(void)
    {
      int signals[] = {SIGINT,SIGILL,SIGFPE,SIGSEGV,SIGTERM,SIGABRT};

      for (uint i=0 ; i < sizeof(signals)/sizeof(int) ; i++)
        signal(signals[i], kill_server);
      mysql_cb_init();  // initialize callbacks
    }

  It's clear to me that the mysql server is supposed to handle a
  SIGTERM by shutting down.  If it's not, you may have uncovered a
  bug, and it should be reported.

> I cannot.

What happens?  Is the signal being ignored? What does a truss show?

> 
> -- 
>     DV
>     

-- 
Brian 'you Bastard' Reichert		<[email protected]>
37 Crystal Ave. #303			Daytime number: (603) 434-6842
Derry NH 03038-1713 USA			BSD admin/developer at large
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.