From owner-freebsd-arch Thu Oct 18 11:41:52 2001 Delivered-To: freebsd-arch@freebsd.org Received: from relay.gnf.org (relay.gnf.org [208.44.31.36]) by hub.freebsd.org (Postfix) with ESMTP id 8D8C937B408 for ; Thu, 18 Oct 2001 11:41:45 -0700 (PDT) Received: from mail.gnf.org (smtp.gnf.org [10.0.0.11]) by relay.gnf.org (8.11.6/8.11.6) with ESMTP id f9IIfjs29439; Thu, 18 Oct 2001 11:41:45 -0700 Received: by mail.gnf.org (Postfix, from userid 888) id C1D2A11E508; Thu, 18 Oct 2001 11:38:47 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.gnf.org (Postfix) with ESMTP id BD13F11A576; Thu, 18 Oct 2001 11:38:47 -0700 (PDT) Date: Thu, 18 Oct 2001 11:38:47 -0700 (PDT) From: Gordon Tetlow To: Cc: Subject: Re: New rc.d init script roadmap In-Reply-To: <20011018112752.B20348@dragon.nuxi.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, 18 Oct 2001, David O'Brien wrote: > > > > M4 > > > > Add true dependency checking to the infrastructure so that starting nfsd > > > > will start mountd and rpcbind > > > > > > The dependency checking is part of /etc/rc.d/*. Is there something > > > missing you have found? > > > > Well, once I have booted my machine, I might want to start an nfs server. > > If I just ran /etc/rc.d/nfsd start, it would fail, because that script > > doesn't know enought to start mountd (which in turn doesn't know enough to > > start rpcbind). I had an idea on how to make that all work. But we need to > > crawl before we start sprinting. > > Something must have been missing from your conversion of the rc.d > scripts, because such dependancy infomation is inherent in the NetBSD > rc.d scripts. Here's an example (I'll use nfsd) from NetBSD: #!/bin/sh # # $NetBSD: nfsd,v 1.4 2001/06/16 06:13:10 lukem Exp $ # # PROVIDE: nfsd # REQUIRE: mountd . /etc/rc.subr name="nfsd" rcvar="nfs_server" command="/usr/sbin/${name}" required_vars="mountd rpcbind" load_rc_config $name run_rc_command "$1" All the dependency information is coded in comments. Although, with the required_vars there, it doesn't help to put nfs_server=YES unless you specifically enable mountd and rpcbind, it doesn't do squat. My ultimate goal is to be able to run /etc/rc.d/nfsd forcestart and it would start everything that nfsd needed. I was thinking of writing the script like: #!/bin/sh # # $NetBSD: nfsd,v 1.4 2001/06/16 06:13:10 lukem Exp $ # # PROVIDE: nfsd # REQUIRE: mountd . /etc/rc.subr name="nfsd" rcvar="nfs_server" command="/usr/sbin/${name}" load_rc_config $name depends_on mountd "$1" run_rc_command "$1" This "depends_on" function would figure out (only when starting, of course), whether mountd is started or not, and start it if it isn't. Does that make sense as to what I'm talking about? -gordon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message