xref: /freebsd/libexec/rc/rc.d/ypserv (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
1#!/bin/sh
2#
3#
4
5# PROVIDE: ypserv
6# REQUIRE: rpcbind
7# KEYWORD: shutdown
8
9. /etc/rc.subr
10
11name="ypserv"
12desc="NIS database server"
13rcvar="nis_server_enable"
14
15: ${ypserv_svcj_options:="net_basic"}
16
17load_rc_config $name
18
19command="/usr/sbin/${name}"
20command_args="${nis_server_flags}"
21
22start_precmd="ypserv_prestart"
23
24ypserv_prestart()
25{
26	local _domain
27
28	force_depend rpcbind || return 1
29
30	_domain=`domainname`
31	if [ -z "$_domain" ]; then
32		warn "NIS domainname(1) is not set."
33		return 1
34	fi
35	if [ ! -d /var/yp/$_domain/. ]; then
36		warn "/var/yp/$_domain is not a directory."
37		return 1
38	fi
39}
40
41run_rc_command "$1"
42