From owner-freebsd-hackers Thu Jun 14 4:43: 3 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.noos.fr (camus.noos.net [212.198.2.70]) by hub.freebsd.org (Postfix) with ESMTP id 8E86A37B40B for ; Thu, 14 Jun 2001 04:42:41 -0700 (PDT) (envelope-from clefevre@redirect.to) Received: (qmail 2867300 invoked by uid 0); 14 Jun 2001 11:42:39 -0000 Received: from unknown (HELO gits.dyndns.org) ([212.198.228.81]) (envelope-sender ) by 212.198.2.70 (qmail-ldap-1.03) with SMTP for ; 14 Jun 2001 11:42:39 -0000 Received: (from root@localhost) by gits.dyndns.org (8.11.3/8.11.3) id f5EBgb377502; Thu, 14 Jun 2001 13:42:37 +0200 (CEST) (envelope-from clefevre@redirect.to) To: Andrew Hesford Cc: Gordon Tetlow , Cyrille Lefevre , Jon Parise , Matt Dillon , Will Andrews , Warner Losh , Mark Santcroos , Doug Barton , bsddiy@163.net, freebsd-hackers@FreeBSD.ORG Subject: Re: import NetBSD rc system References: <20010613202415.A3689@core.usrlib.org> X-Face: V|+c;4!|B?E%BE^{E6);aI.[<97Zd*>^#%Y5Cxv;%Y[PT-LW3;A:fRrJ8+^k"e7@+30g0YD0*^^3jgyShN7o?a]C la*Zv'5NA,=963bM%J^o]C Reply-To: Cyrille Lefevre In-Reply-To: <20010613202415.A3689@core.usrlib.org> Mail-Copies-To: never From: Cyrille Lefevre Date: 14 Jun 2001 13:42:36 +0200 Message-ID: <4rtjnv83.fsf@gits.dyndns.org> Lines: 98 User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Cuyahoga Valley) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Andrew Hesford writes: > On Wed, Jun 13, 2001 at 06:04:23PM -0700, Gordon Tetlow wrote: [snip] > > > > Anyway, here's my status: > > rcorder ported (one line code change) CPPFLAGS -> CFLAGS in Makefile I suppose ? > Alternatively, give up the handy feature of being able to start services > from their own scripts, and have a wrapper script that starts the > specified service and satisfies dependencies. This has the distinct > advantage of not having to call dep_check in each dependent script. > Furthermore, it allows us to start, say, nfsd.sh, knowing full well that > mountd is running, without worrying about some dependency checker trying > to start a new mountd. in fact, the require keyword isn't sufficient in it's own. there should be pre_require and post_require keywords since nfsd needs to start mountd before to start nfsd then rpc.statd and rpc.lockd have to be started after nfsd. so, you should have something like this : in nfsd : provide=nfsd pre_require="portmap mountd" post_require="statd lockd" in mountd : provide=nfsd pre_require=portmap post_require=nfsd in statd : provide=statd pre_require=nfsd post_require= in lockd : provide=lockd pre_require=nfsd post_require= this should work sell when starting services but may cause a little problem when stopping them. what should happen when doing nfsd stop ? should mountd, statd and lockd stopped as well. how about portmap which isn't only used by nfs services. so the pre_require have to be splitted to handle this case. do you understand what I mean ? I'm currently watching how to do this using the NetBSD rc framework. something like this : in rc, add this before files=`rcorder ...` rcorder () { local _rc_elem _rc_provide _rc_require local _rc_fast_and_loose _rc_fast_run _rc_fast_and_loose=yes _rc_fast_run=yes shift 2 for _rc_elem; do [ -f $_rc_elem ] || continue _rc_provide=$(run_rc_script $_rc_elem provide) for _rc_require in $(run_rc_script $_rc_elem require); do echo $_etc/rc.d/$_rc_require $_etc/rc.d/$_rc_provide done done | tsort } in rc.subr, add the following lines in the case "$_arg" in run_rc_command provide) echo $provide return 0 ;; require) echo $require return 0 ;; in every scripts, change # PROVIDE: and # REQUIRE: lines to variable assignment. for instance, this isn't sufficient since all scripts have to do the equivalent tinhgs done in the top level rc startup script to be complete. well, I'm working on this. Cyrille. -- home: mailto:clefevre@redirect.to UNIX is user-friendly; it's just particular work: mailto:Cyrille.Lefevre@edf.fr about who it chooses to be friends with. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message