[BACK]Return to ypserv CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / etc / rc.d

File: [cvs.NetBSD.org] / src / etc / rc.d / ypserv (download)

Revision 1.5.6.1, Mon May 9 22:42:13 2005 UTC (14 years, 5 months ago) by riz
Branch: netbsd-2
CVS Tags: netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1
Changes since 1.5: +2 -1 lines

Pull up revision 1.8 (requested by lukem in ticket #1269):
Use 'load_rc_config_var CMD VAR' to set VAR for "foreign" rc.conf(5)
variables that may be set in /etc/rc.conf.d/CMD instead of /etc/rc.conf.
Fixes PR 20786 from Pavel Cahyna.

#!/bin/sh
#
# $NetBSD: ypserv,v 1.5.6.1 2005/05/09 22:42:13 riz 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
load_rc_config_var rpcbind rpcbind
run_rc_command "$1"