On Sun, Oct 22, 2000 at 09:41:51PM -0400, Bill Vermillion wrote:
> One of the reasons for the numbers in the SysVR4 arena is to
> set the order of execution so programs which other depend upon
> are executed first.  How does the NetBSD solve this problem.

Very coolly.  The main rc script runs a script named `rcorder' to
generate the proper order.  rc.shutdown also uses `rcorder' but reverses
the ordering.  Two examples are included below to show what `rcorder'
uses to generate the list.  These NetBSD rc files also provide "start",
"stop", "restart", "status", etc. commands to assist the sysadmin.
Again, *very* slick and still quite BSD-like.


=== /etc/rc.d/ypbind ===
#!/bin/sh
#
# $NetBSD: ypbind,v 1.3 2000/05/13 08:45:10 lukem Exp $
#

# PROVIDE: ypbind
# REQUIRE: ypserv

. /etc/rc.subr

name="ypbind"
rcvar=$name
command="/usr/sbin/${name}"
start_precmd="ypbind_precmd"

ypbind_precmd()
{
        _domain=`domainname`
        if [ -z "$_domain" ]; then
                warn "domainname(1) is not set."
                return 1
        fi
}

load_rc_config $name
run_rc_command "$1"


=== /etc/rc.d/ypserv ===
#!/bin/sh
#
# $NetBSD: ypserv,v 1.4 2000/06/02 22:54:13 fvdl Exp $
#

# PROVIDE: ypserv
# REQUIRE: rpcbind

. /etc/rc.subr

name="ypserv"
rcvar=$name
command="/usr/sbin/${name}"
required_vars="rpcbind"
start_precmd="ypserv_precmd"

ypserv_precmd()
{
        _domain=`domainname`
        if [ -z "$_domain" ]; then
                warn "domainname(1) is not set."
                return 1
        fi

        if [ ! -d /var/yp/$_domain/. ]; then
                warn "/var/yp/$_domain is not a directory."
                return 1
        fi
}

load_rc_config $name
run_rc_command "$1"


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to