2001-06-16 07:16:14 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2002-06-13 22:14:37 +00:00
|
|
|
# $NetBSD: ypserv,v 1.5 2000/09/19 13:04:39 lukem Exp $
|
|
|
|
# $FreeBSD$
|
2001-06-16 07:16:14 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: ypserv
|
|
|
|
# REQUIRE: rpcbind
|
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="ypserv"
|
2004-01-17 11:19:01 +00:00
|
|
|
rcvar="nis_server_enable"
|
2001-06-16 07:16:14 +00:00
|
|
|
command="/usr/sbin/${name}"
|
2004-01-17 11:19:01 +00:00
|
|
|
start_precmd="ypserv_prestart"
|
2001-06-16 07:16:14 +00:00
|
|
|
|
2003-01-24 00:37:52 +00:00
|
|
|
load_rc_config $name
|
2004-01-17 10:59:43 +00:00
|
|
|
command_args="${nis_server_flags}"
|
2002-06-13 22:14:37 +00:00
|
|
|
|
2004-01-17 11:19:01 +00:00
|
|
|
ypserv_prestart()
|
2001-06-16 07:16:14 +00:00
|
|
|
{
|
2006-12-30 22:53:20 +00:00
|
|
|
local _domain
|
|
|
|
|
2004-01-17 10:59:43 +00:00
|
|
|
if ! checkyesno rpcbind_enable && \
|
|
|
|
! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
|
|
|
|
then
|
|
|
|
force_depend rpcbind || return 1
|
|
|
|
fi
|
2001-06-16 07:16:14 +00:00
|
|
|
_domain=`domainname`
|
|
|
|
if [ -z "$_domain" ]; then
|
2003-07-09 03:21:03 +00:00
|
|
|
warn "NIS domainname(1) is not set."
|
2001-06-16 07:16:14 +00:00
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
if [ ! -d /var/yp/$_domain/. ]; then
|
|
|
|
warn "/var/yp/$_domain is not a directory."
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
run_rc_command "$1"
|