Clemens Fischer | 2 Sep 2003 20:35

Re: Runit scripts and mysql

* Erich Schubert:

>> > ----- mysql/run -----
>> > #!/bin/sh
>> > cd /
>> > umask 077
>> >
>> > MYSQLADMIN='/usr/bin/mysqladmin --defaults-extra-file=/etc/mysql/debian.cnf'
>> >
>> > trap "$MYSQLADMIN shutdown" 0
>> > trap 'exit 2' 1 2 3 15
>> >
>> > /usr/bin/mysqld_safe & wait
>> 
> trap "$MYSQLADMIN shutdown" 1 2 3 15

> would probably also work, but the above method was recommended on a
> web page i read. exit-on-signal and clean-on-exit kind of. ;)

the problem is that i can't use svc(8) to send signals to mysql, those
signals go to the shell calling up mysqld_safe.  i'd like to know
precisely why i need this nasty "/usr/bin/mysqld_safe & wait", which
invites races (in signal delivery).  could you try the "trap
"$MYSQLADMIN shutdown" 1 2 3 15" solution and tell us if it works?

mysql must have clean "exit-on-signal and clean-on-exit" properties
somewhere.  and how about postgres?

  clemens


Gmane