From owner-freebsd-ports@FreeBSD.ORG Mon Dec 5 16:16:57 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 D913216A41F; Mon, 5 Dec 2005 16:16:57 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 61D9743D55; Mon, 5 Dec 2005 16:16:57 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.13.0/8.13.0) with ESMTP id jB5GGuqS011277; Mon, 5 Dec 2005 08:16:56 -0800 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id jB5GGuIE011276; Mon, 5 Dec 2005 08:16:56 -0800 Date: Mon, 5 Dec 2005 08:16:56 -0800 From: Brooks Davis To: Ion-Mihai Tetcu Message-ID: <20051205161656.GC7653@odin.ac.hmc.edu> References: <20051205145805.0db6cf26@it.buh.tecnik93.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GZVR6ND4mMseVXL/" Content-Disposition: inline In-Reply-To: <20051205145805.0db6cf26@it.buh.tecnik93.com> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=8.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on odin.ac.hmc.edu 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 16:16:58 -0000 --GZVR6ND4mMseVXL/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 05, 2005 at 02:58:05PM +0200, Ion-Mihai Tetcu wrote: > Hi, >=20 >=20 > 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). >=20 > Let's take mail/dspam as an example. Obviously it PROVIDE: dspam >=20 > 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). >=20 > Now things start getting interesting. >=20 > Since it's a content filter, it should start before the SMTP server. >=20 > If SMTP server =3D sendmail|courier it's easy: BEFORE: mail >=20 > If it's postfix it's: > - if it's started via /etc/rc.d/sendmail (sendmail_enable=3D"YES" and > postfix in /etc/mail/mailer.conf) BEFORE: mail should be enough (but see > below);=20 > - if sendmail_enable=3D"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 ?) >=20 > How to interact with various ways to start qmail I have yet to discover. >=20 > 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) ? >=20 >=20 > 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 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. 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. 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. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --GZVR6ND4mMseVXL/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFDlGf3XY6L6fI4GtQRAroCAKC0h554in2+JOzvo7M0VNZVw9gupwCfVSYP RTkewPW3xWWBK0DvZUp4hzk= =Nvlt -----END PGP SIGNATURE----- --GZVR6ND4mMseVXL/--