Date: Thu, 10 May 2007 11:16:28 +0200 From: l.cligny@free.fr To: ports@FreeBSD.org Subject: Startup script's race condition with zabbix over MySQL Message-ID: <1178788588.4642e2ec084e2@imp.free.fr>
next in thread | raw e-mail | index | archive | help
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. 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 ? Another issue I found is when zabbix exits after claiming /tmp/mysql.sock doesn't exists, it leave its PID file on /var/tmp/zabbix_server.pid, which avoid also starting zabbix_server, even manually by rc.d script, if we don't remove it before. P.S: sorry for my "English" Cheers, Laurent CLIGNY
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1178788588.4642e2ec084e2>