From owner-cvs-all@FreeBSD.ORG Wed Jul 6 20:33:34 2011 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id DF256106566C; Wed, 6 Jul 2011 20:33:34 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 65-241-43-4.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 53299150664; Wed, 6 Jul 2011 20:33:33 +0000 (UTC) Message-ID: <4E14C69C.8030200@FreeBSD.org> Date: Wed, 06 Jul 2011 13:33:32 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.18) Gecko/20110624 Thunderbird/3.1.11 MIME-Version: 1.0 To: Boris Samorodov References: <201107061434.p66EY0OG062221@repoman.freebsd.org> <4E14B6E4.50609@FreeBSD.org> <00116999@h30.sp.ipt.ru> In-Reply-To: <00116999@h30.sp.ipt.ru> X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: cvs-ports@FreeBSD.org, cvs-all@FreeBSD.org, ports-committers@FreeBSD.org Subject: Re: cvs commit: ports/multimedia/zoneminder/files zm.in X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jul 2011 20:33:35 -0000 On 07/06/2011 13:15, Boris Samorodov wrote: > Hello All, > > Doug, thanks for you help. Glad to help. :) > On Wed, 06 Jul 2011 12:26:28 -0700 Doug Barton wrote: >> On 07/06/2011 07:34, Boris Samorodov wrote: > >>> . do a 10 seconds pause only at system startup. > >> The question is, what is your goal for including that? Does zoneminder >> need this delay after it starts? Before it starts? If so, then the >> right thing to do is likely to put it in either a start_precmd or >> start_postcmd. That way you get 'checkyesno zoneminder_enable' for >> free. If the delay is only applicable at boot time, then you >> can/should include the code that you added in this version. > > Actually the problem is run time mysqld dependency. > The option REQUIRE: mysql is not efficient here. I'm not sure what/how > mysql is started, but zoneminder can not start right after mysql is > up. If I use 5 seconds pause, zoneminder starts successfully at 50% > of bootings. Ten seconds pause is enough to start zoneminder. > > So, this delay is needed only at machine booting time. I'm not sure if > start_precmd is any way better here. Yeah, you'd want to do that in a start_precmd, and probably testing for autoboot is better than faststart. So something like: start_precmd=zm_prestart zm_prestart() { [ -n "$autoboot" ] && sleep 10 } Of course, if there was some mysql command you could run to verify that the db is up that would be better than an unconditional sleep. Something like this: zm_prestart() { local _count=0 while : ; do && return _count=$(( $_count + 1 )) if [ $_count -gt 10 ]; then err 1 "${name}: failed" fi sleep 1 done } hth, Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/