From owner-freebsd-rc@FreeBSD.ORG Thu Dec 1 19:31:54 2011 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9568106566C; Thu, 1 Dec 2011 19:31:54 +0000 (UTC) (envelope-from cvs-src@yandex.ru) Received: from forward20.mail.yandex.net (forward20.mail.yandex.net [IPv6:2a02:6b8:0:1402::5]) by mx1.freebsd.org (Postfix) with ESMTP id 33FA48FC08; Thu, 1 Dec 2011 19:31:54 +0000 (UTC) Received: from smtp17.mail.yandex.net (smtp17.mail.yandex.net [95.108.252.17]) by forward20.mail.yandex.net (Yandex) with ESMTP id 58F7F10427AF; Thu, 1 Dec 2011 23:31:50 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1322767910; bh=xTJku+TE/QVJmOkNInbW2MDTr5cw5Axv/vii14a/3eA=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=ljJFwioUyIAFJVqWqub2Lv0PIvUQJw7EjRAqoGBPRiyYu4Jif1gIBC3LprT9ySbrN lpNDjqQygRfGu0cQqotdLkTlOup2Vn7KfLveBOLGBM0cW5/uS8UXyN3BP9B70sOL2l wCe7jH7LJUovzNqDUhwSr02bOjjGSpqbgYmDR2nw= Received: from smtp17.mail.yandex.net (localhost [127.0.0.1]) by smtp17.mail.yandex.net (Yandex) with ESMTP id 2AAB519001D0; Thu, 1 Dec 2011 23:31:50 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1322767910; bh=xTJku+TE/QVJmOkNInbW2MDTr5cw5Axv/vii14a/3eA=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=ljJFwioUyIAFJVqWqub2Lv0PIvUQJw7EjRAqoGBPRiyYu4Jif1gIBC3LprT9ySbrN lpNDjqQygRfGu0cQqotdLkTlOup2Vn7KfLveBOLGBM0cW5/uS8UXyN3BP9B70sOL2l wCe7jH7LJUovzNqDUhwSr02bOjjGSpqbgYmDR2nw= Received: from unknown (unknown [178.76.224.133]) by smtp17.mail.yandex.net (nwsmtp/Yandex) with ESMTP id VmxKEDLn-VnxK72cs; Thu, 1 Dec 2011 23:31:49 +0400 X-Yandex-Spam: 1 Message-ID: <4ED7D611.50604@yandex.ru> Date: Thu, 01 Dec 2011 23:31:29 +0400 From: Ruslan Mahmatkhanov User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:8.0) Gecko/20111109 Thunderbird/8.0 MIME-Version: 1.0 To: Doug Barton References: <4ED66DCB.1040102@yandex.ru> <4ED67B8F.50109@yandex.ru> <4ED6BE87.4060408@FreeBSD.org> In-Reply-To: <4ED6BE87.4060408@FreeBSD.org> X-Enigmail-Version: undefined Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-rc@freebsd.org Subject: Re: rc-script review request X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2011 19:31:54 -0000 Doug Barton wrote on 01.12.2011 03:38: > > I think that what you need is to provide at least one default, so after > the default for _enable you'd have something like this: > > : ${zope213_instances:=%%PREFIX%%} > (assuming that /usr/local is the default > > Then you need an additional function: > > zope213_check_instances () { > cmd="$1" > shift > > if [ -n "$@" ]; then > zope213_instances="$@" > elif [ -z "$zope213_instances" ]; then > err 1 "No value for zope213_instances, so nothing to do" > fi > } > > And call that function first in each of your start/stop/restart functions. > > You should test that of course. :) > > > hth, > > Doug > Ok, i merged all the changes by you including zope213_check_instances() and default instance directory. I had tested it both with default instance and with multiple instances - all is working just fine, thank you much! The only thing that is looking bad is: - f.e i have two instances in /usr/local/www/Zope213 - MyFirstInstance and MySecondInstance (they use different tcp ports) - i have in my rc.conf: zope213_enable="YES" #zope213_instances="/usr/local/www/Zope213/MyFirstInstance /usr/local/www/Zope213/MySecondInstance" ^^^^^^^^^^^^^^^^^^^^^^ it's a single line actually - i trying to start zope: service zope213 start - i'm getting: Starting Zope 2.13: Zope instance /usr/local/www/Zope213/ -> eval: /usr/local/www/Zope213//bin/zopectl: not found . As far i understand there should be something like "exit 1" somewhere, but i don't understand where exactly. Would you please help? There is also some problem with $*/$@ stuff. I was able to make it work only by combining them. You can see the updated script here: https://github.com/mexicarne/zope/blob/master/www/zope213/files/zope213.in Thanks. -- Regards, Ruslan Tinderboxing kills... the drives.