From owner-freebsd-ports@FreeBSD.ORG Wed Jan 11 18:16:48 2012 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C34E51065670; Wed, 11 Jan 2012 18:16:48 +0000 (UTC) (envelope-from bsam@passap.ru) Received: from forward12.mail.yandex.net (forward12.mail.yandex.net [IPv6:2a02:6b8:0:801::2]) by mx1.freebsd.org (Postfix) with ESMTP id 48F9C8FC16; Wed, 11 Jan 2012 18:16:48 +0000 (UTC) Received: from smtp12.mail.yandex.net (smtp12.mail.yandex.net [95.108.131.191]) by forward12.mail.yandex.net (Yandex) with ESMTP id A3AD1C23748; Wed, 11 Jan 2012 22:16:46 +0400 (MSK) Received: from smtp12.mail.yandex.net (localhost [127.0.0.1]) by smtp12.mail.yandex.net (Yandex) with ESMTP id 6ABF216A03E5; Wed, 11 Jan 2012 22:16:46 +0400 (MSK) Received: from 93.91.10.137.tel.ru (93.91.10.137.tel.ru [93.91.10.137]) by smtp12.mail.yandex.net (nwsmtp/Yandex) with ESMTP id GjmaIq40-Gkmm0Jd9; Wed, 11 Jan 2012 22:16:46 +0400 X-Yandex-Spam: 1 Message-ID: <4F0DD20D.7010002@passap.ru> Date: Wed, 11 Jan 2012 22:16:45 +0400 From: Boris Samorodov User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:8.0) Gecko/20111114 Thunderbird/8.0 MIME-Version: 1.0 To: Mark Felder References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Wed, 11 Jan 2012 18:30:44 +0000 Cc: bsam@freebsd.org, freebsd-ports@freebsd.org Subject: Re: multimedia/zoneminder: rc script runs mysql commands? X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 18:16:48 -0000 11.01.2012 21:58, Mark Felder пишет: > > The zoneminder port has this in its rc script which really should go away: > > zm_prestart() { > local _count=0 > > while : ; do > echo "USE zm; SELECT Username from Users where Id=1;" | \ > /usr/local/bin/mysqltest -u root zm > /dev/null > 2>&1 && return > _count=$(( $_count + 1 )) > if [ $_count -gt 10 ]; then > err 1 "${name}: mysqltest command failed" > fi > > sleep 1 > done > } > If you have your mysql install on a different server (which you should if > you have tons of cameras and events) the startup fails to work. I can't > see a reason why this should be kept, but perhaps someone else has an > idea? This isn't a common practice in any other program that requires a > database.... The problem is: while start-up zoneminder is launched after mysql was started but is not responding yet. Then zoneminder can't register it's cameras, etc. This hack was introduced to catch the moment when mysql really is operational and then start zoneminder. If someone has a solution -- you are welcome. -- WBR, Boris Samorodov (bsam) FreeBSD Committer, http://www.FreeBSD.org The Power To Serve