List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:October 20 1999 4:59pm
Subject:Re: mysqld dies and does not restarts itself even id started as
safe_mysqld (BSDI 4.0.1)
View as plain text  
>>>>> "Javier" == Javier Vegas <javier@stripped> writes:

Javier> Vivek Khera wrote:
>> 
>> >>>>> "JV" == Javier Vegas <javier@stripped> writes:
>> 
JV> Again, I dont care so much that it crashes, but is not supposed to
JV> monitor
JV> and restart itself?
>> 
>> If it crashes, it should restart. If it exits cleanly, it will not
>> restart under the assumption that it was told to shutdown.

Javier> I may have found why it is not restarting when crashing:

Javier> Looking through the safe_mysqld script, it assumes the pid_file
Javier> is  $DATADIR/`/bin/hostname`.pid , which in my case is
Javier> /usr/local/mysql/var/machine.domain.com.pid
Javier> (/bin/hostaname gives machine.domain.com).
Javier> However, looking in the var directory, the file that contains the pid is
Javier> actually called
Javier> /usr/local/mysql/var/machine.pid (to make things even more confusing,
Javier> the error log is
Javier> called usr/local/mysql/var/machine.domain.com.pid)
Javier> So when mysqld crashes, safe_mysqld looks for
Javier> /usr/local/mysql/var/machine.domain.com.pid,
Javier> does not find it, assumes it was shut down cleanly, and goes away.

Javier> So it seems there is some discrepancy between how the hostname is
Javier> obtained when starting
Javier> mysqld and when safe_mysqld is monitoring.
Javier> As a temporary fix, I created 
Javier> /usr/local/mysql/var/machine.domain.com.pid as a 
Javier> symbolic link to /usr/local/mysql/var/machine.pid.

Javier> Does this sound reasonable, or am I totally off?

Hi!

The proper way is probably to edit /etc/hosts to get your host names right.

Anyway, you can change safe_mysqld to use the --pid-file argument to
mysqld to force it to use the same file name as safe_mysqld.

Regards,
Monty
Thread
mysqld dies and does not restarts itself even id started as safe_mysqld (BSDI)Javier Vegas18 Oct
  • Re: mysqld dies and does not restarts itself even id started as safe_mysqld (BSDI)Vivek Khera18 Oct
  • Re: mysqld dies and does not restarts itself even id started as safe_mysqld (BSDI 4.0.1)Javier Vegas20 Oct
    • Re: mysqld dies and does not restarts itself even id started as safe_mysqld (BSDI 4.0.1)Vivek Khera20 Oct
    • Re: mysqld dies and does not restarts itself even id started as safe_mysqld (BSDI 4.0.1)Michael Widenius20 Oct