From owner-freebsd-ports@FreeBSD.ORG Mon Dec 5 17:09:24 2005 Return-Path: X-Original-To: ports@freebsd.org Delivered-To: freebsd-ports@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C586D16A43C for ; Mon, 5 Dec 2005 17:09:24 +0000 (GMT) (envelope-from itetcu@people.tecnik93.com) Received: from smtp.rdsnet.ro (smtp.rdsnet.ro [62.231.74.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id EF07443D72 for ; Mon, 5 Dec 2005 17:09:22 +0000 (GMT) (envelope-from itetcu@people.tecnik93.com) Received: (qmail 16590 invoked by uid 89); 5 Dec 2005 17:09:19 -0000 Received: from unknown (HELO it.buh.tecnik93.com) (81.196.204.98) by 0 with SMTP; 5 Dec 2005 17:09:19 -0000 Received: from it.buh.tecnik93.com (localhost [127.0.0.1]) by it.buh.tecnik93.com (Postfix) with ESMTP id 6A39ABA5E; Mon, 5 Dec 2005 19:09:06 +0200 (EET) Date: Mon, 5 Dec 2005 19:09:05 +0200 From: Ion-Mihai Tetcu To: Brooks Davis Message-ID: <20051205190905.28ad8a0a@it.buh.tecnik93.com> In-Reply-To: <20051205161656.GC7653@odin.ac.hmc.edu> References: <20051205145805.0db6cf26@it.buh.tecnik93.com> <20051205161656.GC7653@odin.ac.hmc.edu> X-Mailer: Sylpheed-Claws 1.9.100 (GTK+ 2.8.8; i386-portbld-freebsd6.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: ports@freebsd.org, freebsd-rc@freebsd.org Subject: Re: RC keywords question 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: Mon, 05 Dec 2005 17:09:25 -0000 On Mon, 5 Dec 2005 08:16:56 -0800 Brooks Davis wrote: > On Mon, Dec 05, 2005 at 02:58:05PM +0200, Ion-Mihai Tetcu wrote: > > Hi, > > > > > > I'm converting my ports to work with the new HEAD RC style and > > while at it I also thought to check the keywords to make sure > > they're OK. Read rcorder(8) and rc(8). > > > > Let's take mail/dspam as an example. Obviously it PROVIDE: dspam > > > > When run in --daemon mode dspam receives messages via LMTP and > > deliver them via SMTP. So it REQUIRE: NETWORK; it also uses syslogd > > (which starts BEFORE: SERVERS). > > > > Now things start getting interesting. > > > > Since it's a content filter, it should start before the SMTP server. > > > > If SMTP server = sendmail|courier it's easy: BEFORE: mail > > > > If it's postfix it's: > > - if it's started via /etc/rc.d/sendmail (sendmail_enable="YES" and > > postfix in /etc/mail/mailer.conf) BEFORE: mail should be enough > > (but see below); > > - if sendmail_enable="NO" and /usr/local/sbin/postfix is linked in > > rc.d as sendmail.sh then BEFORE: mail should be OK too since that's > > before rc.d/localpkg (right ?) > > > > How to interact with various ways to start qmail I have yet to > > discover. > > > > So until here I would have: > > PROVIDE: dspam > > REQUIRE: NETWORK syslogd > > BEFORE: mail > > and since mail REQUIRE: LOGIN this is actually: > > REQUIRE: NETWORK syslogd LOGIN > > > > Q: should I write all the REQUIRE keywords or just the last one > > (LOGIN) ? > > > > > > OK, now dspam could also use mysql or pgsql; if the dependency is > > set at compile time, it's easy to have the right REQUIRE; but dspam > > can also use either or none, as instructed in dspam.conf so this is > > also settable at run-time. How can I write the REQUIRE: line in > > this case ? > > > "BEFORE: mail" acts for most intents and purposes like all mail > scripts contained "REQUIRE: dspam" so dspam does not depend on > LOGIN. As a rule, there's no point in depending on syslogd, just I think it's better if I make sure dspam starts before its potential consumers that the other way around; and this for one reason: I know that my port's consumers are mail servers, but making each mail server OPTIONally depend of each content filter is obviously unfeasible (of course I counld ask the user to modify his server's rc script by hand). Please correct me if I'm wrong. > depend on SERVERS instead. This is actually what DAEMON is. I'd say > that virtually all ports should "REQUIRE: DAEMON" unless they have > more specific requirements. So I should have REQUIRE: DAEMON and that's all ? Do I understand this right: BEFORE is for approximately selecting when the server should start while REQUIRE actually asks for something to be running ? > For the database support, I'd suggest > setting the dependencies based on the ports configure options. It's > harmless to depend on something that doesn't actually run, but > annoying to depend on something that doesn't exist. In my case the user either select one database back-end and that is statically compiled and then I e.g USE_MYSQL and I can write my BEFORE line (that's what I'm doing now for mysql); Or select multiple WITH_DB_NAME OPTIONS and have support for loading any of them at runtime. For this case what I'm asking is: is there any way to hook-in a script that would parse dspam.conf, see what DB is set and REQUIERE the right thing ? > The correct solution for databases is probably to add a new dummy > script DATABASES which all the database startup scripts should declare > they run BEFORE. Then other startup scripts could REQUIRE that > unconditionally even if they aren't currently configured to use a > database and none are installed. And what do I do until then ? Or I just let the script as it is (.sh) on 7.x also ? Thanks, -- IOnut - Unregistered ;) FreeBSD "user" "Intellectual Property" is nowhere near as valuable as "Intellect" BOFH excuse #406: Bad cafeteria food landed all the sysadmins in the hospital