Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 May 2007 20:18:46 +0100
From:      RW <fbsd06@mlists.homeunix.com>
To:        freebsd-ports@freebsd.org
Subject:   Re: Startup script's race condition with zabbix over MySQL
Message-ID:  <20070510201846.76992f5b@gumby.homeunix.com.>
In-Reply-To: <1178788588.4642e2ec084e2@imp.free.fr>
References:  <1178788588.4642e2ec084e2@imp.free.fr>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 10 May 2007 11:16:28 +0200
l.cligny@free.fr wrote:

> 
> Hello,
> 
> I've set up a FreeBSD 6.2-RELEASE Box to act as a zabbix server.
> 
> The relevant packages I use are:
> 
> zabbix-1.1.7,1
> mysql-server-5.0.37
> 
> Fisrt of all, both software works properly, my setup run well if I
> run them manually via /usr/local/etc/rc.d. No error messages.
> 
> But I had a problem when I put the MySQL and zabbix_server services
> to run in /etc/rc.conf, in order to start them at startup.

They belong in /usr/local/etc/rc.d

> In fact the MySQL start first, and then the zabbix-server follows
> immediately, which makes sense, (I made it sure by adding "# REQUIRE
> mysql", without quotes, to the head
> of /usr/local/etc/rc.d/zabbix-server script). So the logic startup
> order is respected.
> 
> But, at every boot, my zabbix-server daemon won't start, the zabbix's
> log file saying "could not connect to socket "/tmp/mysql.sock"". So I
> put a dirty "sleep 10" in /usr/local/etc/rc.d/zabbix_server script,
> just after variables declarations, and now it works well at each
> startup.
> 
> Does some of you guys have a better method to fix this race-condition
> behavior (maybe a "file exists" condition over the /tmp/mysql.sock
> file or so), in the zabbix_server FreeBSD startup script ?

I would suggest you you write a new script that's ordered between the
two, and waits for the socket. That avoids having to maintain any
modifications to port installed scripts.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070510201846.76992f5b>