Luke Mewburn has indicated that they (NetBSD) are not interested

in keeping the scripts under rc.d in sync with us. So, remove
NetBSD specific stuff (which made our scripts more complicated
than necessary).

The NetBSD ident string will be left intact, both for history and
also incase we wish to pull in future versions.
This commit is contained in:
Mike Makonnen 2004-01-17 10:59:43 +00:00
parent 5e289f9eb6
commit 82387f41ed
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=124622
25 changed files with 210 additions and 517 deletions

View File

@ -13,20 +13,10 @@
arg=$1
case ${OSTYPE} in
FreeBSD)
RCVAR_SERVER="nfs_server_enable"
RCVAR_CLIENT="nfs_client_enable"
RCVAR_STATD="rpc_statd_enable"
RCVAR_LOCKD="rpc_lockd_enable"
;;
NetBSD)
RCVAR_SERVER="nfs_server"
RCVAR_CLIENT="nfs_client"
RCVAR_STATD="statd"
RCVAR_LOCKD="lockd"
;;
esac
RCVAR_SERVER="nfs_server_enable"
RCVAR_CLIENT="nfs_client_enable"
RCVAR_STATD="rpc_statd_enable"
RCVAR_LOCKD="rpc_lockd_enable"
start_precmd='checkyesno ${RCVAR_SERVER} || checkyesno ${RCVAR_CLIENT} ||
[ -n "$rc_force" ]'

View File

@ -12,16 +12,8 @@
name="mountcritremote"
stop_cmd=":"
case ${OSTYPE} in
FreeBSD)
start_cmd="mountcritremote_start"
start_precmd="mountcritremote_precmd"
;;
NetBSD)
start_cmd="mountcritremote_start"
;;
esac
start_cmd="mountcritremote_start"
start_precmd="mountcritremote_precmd"
# Mount NFS filesystems if present in /etc/fstab
#
@ -47,50 +39,39 @@ mountcritremote_precmd()
mountcritremote_start()
{
case ${OSTYPE} in
FreeBSD)
# Mount nfs filesystems.
#
echo -n 'Mounting NFS file systems:'
mount -a -t nfs
echo '.'
# Mount nfs filesystems.
#
echo -n 'Mounting NFS file systems:'
mount -a -t nfs
echo '.'
# Mount other network filesystems if present in /etc/fstab.
case ${extra_netfs_types} in
[Nn][Oo])
;;
*)
netfs_types="${netfs_types} ${extra_netfs_types}"
;;
esac
for i in ${netfs_types}; do
fstype=${i%:*}
fsdecr=${i#*:}
[ "${fstype}" = "nfs" ] && continue
case "`mount -d -a -t ${fstype}`" in
*mount_${fstype}*)
echo -n "Mounting ${fsdecr} file systems:"
mount -a -t ${fstype}
echo '.'
;;
esac
done
# Cleanup /var again just in case it's a network mount.
/etc/rc.d/cleanvar reload
rm -f /var/run/clean_var /var/spool/lock/clean_var
# Mount other network filesystems if present in /etc/fstab.
case ${extra_netfs_types} in
[Nn][Oo])
;;
NetBSD)
# Mount critical filesystems that may be `remote'.
# (as specified in $critical_filesystems_remote)
# This usually includes /usr.
#
mount_critical_filesystems remote
*)
netfs_types="${netfs_types} ${extra_netfs_types}"
;;
esac
for i in ${netfs_types}; do
fstype=${i%:*}
fsdecr=${i#*:}
[ "${fstype}" = "nfs" ] && continue
case "`mount -d -a -t ${fstype}`" in
*mount_${fstype}*)
echo -n "Mounting ${fsdecr} file systems:"
mount -a -t ${fstype}
echo '.'
;;
esac
done
# Cleanup /var again just in case it's a network mount.
/etc/rc.d/cleanvar reload
rm -f /var/run/clean_var /var/spool/lock/clean_var
}
load_rc_config $name

View File

@ -17,17 +17,8 @@ command="/usr/sbin/${name}"
start_precmd="named_precmd"
required_dirs="$named_chrootdir" # if it is set, it must exist
extra_commands="reload"
case ${OSTYPE} in
FreeBSD)
nuser=bind
ngroup=bind
;;
NetBSD)
nuser=named
ngroup=named
;;
esac
nuser=bind
ngroup=bind
# If running in a chroot cage, ensure that the appropriate files
# exist inside the cage, as well as helper symlinks into the cage
@ -78,40 +69,22 @@ make_symlinks()
named_precmd()
{
case ${OSTYPE} in
FreeBSD)
! checkyesno named_rcng && return 0
# Is the user using a sandbox?
if [ -z "$named_chrootdir" ]; then
rc_flags="-u $nuser -g $ngroup $rc_flags"
return 0
fi
! checkyesno named_rcng && return 0
# Is the user using a sandbox?
if [ -z "$named_chrootdir" ]; then
rc_flags="-u $nuser -g $ngroup $rc_flags"
return 0
fi
# Do the following checks only if the user wants them done
checkyesno named_chroot_autoupdate && chroot_autoupdate
;;
NetBSD)
chroot_autoupdate
;;
esac
# Do the following checks only if the user wants them done
checkyesno named_chroot_autoupdate && chroot_autoupdate
case ${OSTYPE} in
FreeBSD)
# Make the symlinks only if the user wants them done.
checkyesno named_symlink_enable && make_symlinks
;;
NetBSD)
make_symlinks
;;
esac
# Make the symlinks only if the user wants them done.
checkyesno named_symlink_enable && make_symlinks
# Change run_rc_commands()'s internal copy of $named_flags
#
case ${OSTYPE} in
FreeBSD)
! checkyesno named_rcng && return
;;
esac
! checkyesno named_rcng && return
rc_flags="-u $nuser -g $ngroup -t ${named_chrootdir} $rc_flags"
}

View File

@ -15,17 +15,9 @@ rcvar=`set_rcvar nfs_server`
command="/usr/sbin/${name}"
load_rc_config $name
case ${OSTYPE} in
FreeBSD)
command_args="${nfs_server_flags}"
start_precmd="nfsd_precmd"
sig_stop="USR1"
;;
NetBSD)
required_vars="mountd rpcbind"
start_precmd=
;;
esac
command_args="${nfs_server_flags}"
start_precmd="nfsd_precmd"
sig_stop="USR1"
nfsd_precmd()
{

View File

@ -13,20 +13,10 @@
arg=$1
case ${OSTYPE} in
FreeBSD)
RCVAR_SERVER="nfs_server_enable"
RCVAR_CLIENT="nfs_client_enable"
RCVAR_STATD="rpc_statd_enable"
RCVAR_LOCKD="rpc_lockd_enable"
;;
NetBSD)
RCVAR_SERVER="nfs_server"
RCVAR_CLIENT="nfs_client"
RCVAR_STATD="statd"
RCVAR_LOCKD="lockd"
;;
esac
RCVAR_SERVER="nfs_server_enable"
RCVAR_CLIENT="nfs_client_enable"
RCVAR_STATD="rpc_statd_enable"
RCVAR_LOCKD="rpc_lockd_enable"
start_precmd='checkyesno ${RCVAR_SERVER} || checkyesno ${RCVAR_CLIENT} ||
[ -n "$rc_force" ]'

View File

@ -17,12 +17,6 @@ command="/usr/sbin/${name}"
pidfile="/var/run/${name}.pid"
required_files="/etc/ntp.conf"
case ${OSTYPE} in
NetBSD)
start_precmd="ntpd_precmd"
;;
esac
ntpd_precmd()
{
if [ -z "$ntpd_chrootdir" ]; then

View File

@ -12,18 +12,9 @@
name="ntpdate"
rcvar=`set_rcvar`
case ${OSTYPE} in
FreeBSD)
command="/usr/sbin/${name}"
command_args=">/dev/null 2>&1"
pidfile="/var/run/${name}.pid"
;;
NetBSD)
start_cmd="ntpdate_start"
stop_cmd=":"
;;
esac
command="/usr/sbin/${name}"
command_args=">/dev/null 2>&1"
pidfile="/var/run/${name}.pid"
ntpdate_start()
{

View File

@ -16,36 +16,27 @@ stop_cmd=":"
root_start()
{
case ${OSTYPE} in
FreeBSD)
# root normally must be read/write, but if this is a BOOTP NFS
# diskless boot it does not have to be.
#
case ${root_rw_mount} in
[Nn][Oo] | '')
;;
*)
if ! mount -u -o rw /; then
echo 'Mounting root filesystem rw failed, startup aborted'
/bin/kill -QUIT $$
fi
;;
esac
umount -a >/dev/null 2>&1
# If we booted a special kernel remove the record
# so we will boot the default kernel next time.
if [ -e /boot/nextkernel ]; then
rm -f /boot/nextkernel
# root normally must be read/write, but if this is a BOOTP NFS
# diskless boot it does not have to be.
#
case ${root_rw_mount} in
[Nn][Oo] | '')
;;
*)
if ! mount -u -o rw /; then
echo 'Mounting root filesystem rw failed, startup aborted'
/bin/kill -QUIT $$
fi
;;
NetBSD)
umount -a >/dev/null 2>&1
mount /
rm -f /fastboot
;;
esac
umount -a >/dev/null 2>&1
# If we booted a special kernel remove the record
# so we will boot the default kernel next time.
if [ -e /boot/nextkernel ]; then
rm -f /boot/nextkernel
fi
}
load_rc_config $name

View File

@ -19,16 +19,8 @@ name="route6d"
#
load_rc_config $name
case ${OSTYPE} in
FreeBSD)
rcvar="ipv6_router_enable"
command="${ipv6_router:-/usr/sbin/${name}}"
eval ${name}_flags=\"${ipv6_router_flags}\"
;;
NetBSD)
rcvar=$name
command="/usr/sbin/${name}"
;;
esac
rcvar="ipv6_router_enable"
command="${ipv6_router:-/usr/sbin/${name}}"
eval ${name}_flags=\"${ipv6_router_flags}\"
run_rc_command "$1"

View File

@ -18,19 +18,10 @@ name="routed"
#
load_rc_config $name
case ${OSTYPE} in
FreeBSD)
rcvar="router_enable"
command="${router:-/sbin/${name}}"
eval ${name}_flags=${router_flags}
start_precmd=
;;
NetBSD)
rcvar=${name}
command="/sbin/${name}"
start_precmd="routed_precmd"
;;
esac
rcvar="router_enable"
command="${router:-/sbin/${name}}"
eval ${name}_flags=${router_flags}
start_precmd=
routed_precmd()
{

View File

@ -14,11 +14,5 @@ name="rpcbind"
rcvar=`set_rcvar`
command="/usr/sbin/${name}"
case ${OSTYPE} in
NetBSD)
pidfile="/var/run/${name}.pid"
;;
esac
load_rc_config $name
run_rc_command "$1"

View File

@ -18,14 +18,7 @@ start_precmd="rtadvd_precmd"
rtadvd_precmd()
{
case ${OSTYPE} in
FreeBSD)
IS_GATEWAY="checkyesno ipv6_gateway_enable"
;;
NetBSD)
IS_GATEWAY="eval [ \"$ip6mode\" = \"router\" ]"
;;
esac
IS_GATEWAY="checkyesno ipv6_gateway_enable"
if ! ${IS_GATEWAY}; then
warn \
"${name} cannot be used on IPv6 host, only on an IPv6 router."
@ -45,35 +38,31 @@ rtadvd_precmd()
# from another machine, so if you enable this, do it with
# enough care.)
#
case ${OSTYPE} in
FreeBSD)
# If specific interfaces haven't been specified,
# get a list of interfaces and enable it on them
#
case ${rtadvd_interfaces} in
'')
for i in `ifconfig -l` ; do
case $i in
lo0|gif[0-9]*|stf[0-9]*|faith[0-9]*|lp[0-9]*|sl[0-9]*|tun[0-9]*)
continue
;;
*)
rtadvd_interfaces="${rtadvd_interfaces} ${i}"
;;
esac
done
;;
esac
command_args="${rtadvd_interfaces}"
# Enable Router Renumbering, unicast case
# (use correct src/dst addr)
# rtadvd -R "in ipsec ah/transport/fec0:0:0:1::1-fec0:0:0:10::1/require" ${ipv6_network_interfaces}
# Enable Router Renumbering, multicast case
# (use correct src addr)
# rtadvd -R "in ipsec ah/transport/ff05::2-fec0:0:0:10::1/require" ${ipv6_network_interfaces}
# If specific interfaces haven't been specified,
# get a list of interfaces and enable it on them
#
case ${rtadvd_interfaces} in
'')
for i in `ifconfig -l` ; do
case $i in
lo0|gif[0-9]*|stf[0-9]*|faith[0-9]*|lp[0-9]*|sl[0-9]*|tun[0-9]*)
continue
;;
*)
rtadvd_interfaces="${rtadvd_interfaces} ${i}"
;;
esac
done
;;
esac
command_args="${rtadvd_interfaces}"
# Enable Router Renumbering, unicast case
# (use correct src/dst addr)
# rtadvd -R "in ipsec ah/transport/fec0:0:0:1::1-fec0:0:0:10::1/require" ${ipv6_network_interfaces}
# Enable Router Renumbering, multicast case
# (use correct src addr)
# rtadvd -R "in ipsec ah/transport/ff05::2-fec0:0:0:10::1/require" ${ipv6_network_interfaces}
return 0
}

View File

@ -16,12 +16,6 @@ start_cmd="savecore_start"
start_precmd="savecore_prestart"
stop_cmd=":"
case ${OSTYPE} in
NetBSD)
rcvar=$name
;;
esac
savecore_prestart()
{
# ${DUMPDIR} should be a directory or a symbolic link
@ -29,38 +23,28 @@ savecore_prestart()
#
DUMPDIR="${dumpdir:-/var/crash}"
case ${OSTYPE} in
FreeBSD)
# Quit if we have no dump device
case ${dumpdev} in
[Nn][Oo] | '')
debug 'No dump device. Quitting.'
return 1
;;
esac
# If there is no crash directory set it now
case ${dumpdir} in
'')
dumpdir='/var/crash'
;;
[Nn][Oo])
dumpdir='NO'
;;
esac
if [ ! -e "${dumpdev}" -o ! -d "${dumpdir}" ]; then
warn "Wrong dump device or directory. Savecore not run."
return 1
fi
;;
NetBSD)
if [ ! -d "${dumpdir}" ]; then
warn "No /var/crash directory; savecore not run."
return 1
fi
# Quit if we have no dump device
case ${dumpdev} in
[Nn][Oo] | '')
debug 'No dump device. Quitting.'
return 1
;;
esac
# If there is no crash directory set it now
case ${dumpdir} in
'')
dumpdir='/var/crash'
;;
[Nn][Oo])
dumpdir='NO'
;;
esac
if [ ! -e "${dumpdev}" -o ! -d "${dumpdir}" ]; then
warn "Wrong dump device or directory. Savecore not run."
return 1
fi
return 0
}

View File

@ -19,36 +19,11 @@ securelevel_start()
#
/etc/rc.d/sysctl lastload
case ${OSTYPE} in
FreeBSD)
case ${kern_securelevel_enable} in
[Yy][Ee][Ss])
if [ ${kern_securelevel} -ge 0 ]; then
echo 'Raising kernel security level: '
${SYSCTL_W} kern.securelevel=${kern_securelevel}
fi
;;
esac
;;
NetBSD)
# if $securelevel is set higher, change it here, else if
# it is 0, change it to 1 here, before we start daemons
# or login services.
#
osecurelevel=`sysctl -n kern.securelevel`
if [ -n "$securelevel" -a "$securelevel" != "$osecurelevel" ]; then
if [ "$securelevel" -lt "$osecurelevel" ]; then
echo "Can't lower securelevel."
exit 1
else
echo -n "Setting securelevel: "
${SYSCTL_W} kern.securelevel=$securelevel
fi
else
if [ "$osecurelevel" = 0 ]; then
echo -n "Setting securelevel: "
${SYSCTL_W} kern.securelevel=1
fi
case ${kern_securelevel_enable} in
[Yy][Ee][Ss])
if [ ${kern_securelevel} -ge 0 ]; then
echo 'Raising kernel security level: '
${SYSCTL_W} kern.securelevel=${kern_securelevel}
fi
;;
esac

View File

@ -18,29 +18,17 @@
name="sendmail"
rcvar=`set_rcvar`
required_files="/etc/mail/${name}.cf"
command=${sendmail_program:-/usr/sbin/sendmail}
pidfile=${sendmail_pidfile:-/var/run/sendmail.pid}
case ${OSTYPE} in
FreeBSD)
command=${sendmail_program:-/usr/sbin/sendmail}
pidfile=${sendmail_pidfile:-/var/run/sendmail.pid}
load_rc_config $name
load_rc_config $name
case ${sendmail_enable} in
[Nn][Oo][Nn][Ee])
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
;;
esac
;;
NetBSD)
command="/usr/sbin/${name}"
pidfile="/var/run/${name}.pid"
start_precmd="sendmail_precmd"
load_rc_config $name
case ${sendmail_enable} in
[Nn][Oo][Nn][Ee])
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
;;
esac
@ -83,29 +71,25 @@ sendmail_precmd()
run_rc_command "$1"
case ${OSTYPE} in
FreeBSD)
required_files=
required_files=
if ! checkyesno sendmail_enable; then
name="sendmail_submit"
rcvar=`set_rcvar`
start_cmd="${command} ${sendmail_submit_flags}"
run_rc_command "$1"
fi
if ! checkyesno sendmail_outbound_enable; then
name="sendmail_outbound"
rcvar=`set_rcvar`
start_cmd="${command} ${sendmail_outbound_flags}"
run_rc_command "$1"
fi
name="sendmail_clientmqueue"
rcvar="sendmail_msp_queue_enable"
start_cmd="${command} ${sendmail_msp_queue_flags}"
pidfile="${sendmail_mspq_pidfile:-/var/spool/clientmqueue/sm-client.pid}"
required_files="/etc/mail/submit.cf"
if ! checkyesno sendmail_enable; then
name="sendmail_submit"
rcvar=`set_rcvar`
start_cmd="${command} ${sendmail_submit_flags}"
run_rc_command "$1"
;;
esac
fi
if ! checkyesno sendmail_outbound_enable; then
name="sendmail_outbound"
rcvar=`set_rcvar`
start_cmd="${command} ${sendmail_outbound_flags}"
run_rc_command "$1"
fi
name="sendmail_clientmqueue"
rcvar="sendmail_msp_queue_enable"
start_cmd="${command} ${sendmail_msp_queue_flags}"
pidfile="${sendmail_mspq_pidfile:-/var/spool/clientmqueue/sm-client.pid}"
required_files="/etc/mail/submit.cf"
run_rc_command "$1"

View File

@ -16,12 +16,6 @@ keygen_cmd="sshd_keygen"
start_precmd="sshd_precmd"
pidfile="/var/run/${name}.pid"
extra_commands="keygen reload"
case ${OSTYPE} in
NetBSD)
command="/usr/sbin/${name}"
required_files="/etc/ssh/sshd_config"
;;
esac
sshd_keygen()
{

View File

@ -13,20 +13,10 @@
arg=$1
case ${OSTYPE} in
FreeBSD)
RCVAR_SERVER="nfs_server_enable"
RCVAR_CLIENT="nfs_client_enable"
RCVAR_STATD="rpc_statd_enable"
RCVAR_LOCKD="rpc_lockd_enable"
;;
NetBSD)
RCVAR_SERVER="nfs_server"
RCVAR_CLIENT="nfs_client"
RCVAR_STATD="statd"
RCVAR_LOCKD="lockd"
;;
esac
RCVAR_SERVER="nfs_server_enable"
RCVAR_CLIENT="nfs_client_enable"
RCVAR_STATD="rpc_statd_enable"
RCVAR_LOCKD="rpc_lockd_enable"
start_precmd='checkyesno ${RCVAR_SERVER} || checkyesno ${RCVAR_CLIENT} ||
[ -n "$rc_force" ]'

View File

@ -11,20 +11,8 @@
. /etc/rc.subr
name="swap1"
case ${OSTYPE} in
FreeBSD)
start_cmd='swapon -a'
stop_cmd=':'
;;
NetBSD)
# Add all block-type swap devices; these might be necessary
# during disk checks.
#
start_cmd="swap1_start"
stop_cmd="swap1_stop"
;;
esac
start_cmd='swapon -a'
stop_cmd=':'
# Add all block-type swap devices; these might be necessary
# during disk checks.

View File

@ -13,18 +13,10 @@
name="sysctl"
stop_cmd=":"
case ${OSTYPE} in
FreeBSD)
start_cmd="FreeBSD_start"
extra_commands="reload lastload"
reload_cmd="FreeBSD_start"
lastload_cmd="FreeBSD_start last"
;;
NetBSD)
start_cmd="NetBSD_start"
;;
esac
start_cmd="FreeBSD_start"
extra_commands="reload lastload"
reload_cmd="FreeBSD_start"
lastload_cmd="FreeBSD_start last"
FreeBSD_start()
{
@ -58,13 +50,5 @@ FreeBSD_start()
fi
}
NetBSD_start()
{
if [ -r /etc/sysctl.conf ]; then
echo "Setting sysctl variables:"
${SYSCTL} -f /etc/sysctl.conf
fi
}
load_rc_config $name
run_rc_command "$1"

View File

@ -20,18 +20,9 @@ extra_commands="reload"
_sockfile="/var/run/syslogd.sockets"
case ${OSTYPE} in
FreeBSD)
pidfile="/var/run/syslog.pid"
evalargs="rc_flags=\"\`set_socketlist\` \$rc_flags\""
altlog_proglist="named"
;;
NetBSD)
pidfile="/var/run/${name}.pid"
evalargs="rc_flags=\"-P \$_sockfile \$rc_flags\""
altlog_proglist="named ntpd"
;;
esac
pidfile="/var/run/syslog.pid"
evalargs="rc_flags=\"\`set_socketlist\` \$rc_flags\""
altlog_proglist="named"
syslogd_precmd()
{

View File

@ -17,34 +17,15 @@ stop_cmd=":"
ttyflags_start()
{
case ${OSTYPE} in
FreeBSD)
# Whack the pty perms back into shape.
# XXX: there may be more ptys than this; maybe use
# sysctl to find out how many?
#
if ls /dev/tty[pqrsPQRS]* > /dev/null 2>&1; then
chflags 0 /dev/tty[pqrsPQRS]*
chmod 666 /dev/tty[pqrsPQRS]*
chown root:wheel /dev/tty[pqrsPQRS]*
fi
;;
NetBSD)
# set flags on ttys.
# (do early, in case they use tty for SLIP in network)
#
echo "Setting tty flags."
ttyflags -a
# setup ptys
#
# XXX: there may be more ptys than this; maybe use
# sysctl to find out how many?
#
chmod 666 /dev/tty[pqrs]*
;;
esac
# Whack the pty perms back into shape.
# XXX: there may be more ptys than this; maybe use
# sysctl to find out how many?
#
if ls /dev/tty[pqrsPQRS]* > /dev/null 2>&1; then
chflags 0 /dev/tty[pqrsPQRS]*
chmod 666 /dev/tty[pqrsPQRS]*
chown root:wheel /dev/tty[pqrsPQRS]*
fi
}
load_rc_config $name

View File

@ -15,15 +15,7 @@
name="virecover"
stop_cmd=":"
case ${OSTYPE} in
FreeBSD)
start_cmd="virecover_start"
;;
NetBSD)
command="/usr/libexec/${name}"
;;
esac
start_cmd="virecover_start"
virecover_start()
{

View File

@ -16,27 +16,16 @@ command="/usr/sbin/${name}"
start_precmd="ypbind_precmd"
load_rc_config $name
case ${OSTYPE} in
FreeBSD)
rcvar="nis_client_enable"
command_args="${nis_client_flags}"
;;
NetBSD)
rcvar=$name
;;
esac
rcvar="nis_client_enable"
command_args="${nis_client_flags}"
ypbind_precmd()
{
case ${OSTYPE} in
FreeBSD)
if ! checkyesno rpcbind_enable && \
! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
then
force_depend rpcbind || return 1
fi
;;
esac
if ! checkyesno rpcbind_enable && \
! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
then
force_depend rpcbind || return 1
fi
_domain=`domainname`
if [ -z "$_domain" ]; then

View File

@ -16,34 +16,21 @@ command="/usr/sbin/rpc.${name}"
start_precmd="yppasswdd_precmd"
load_rc_config $name
case ${OSTYPE} in
FreeBSD)
rcvar="nis_yppasswdd_enable"
command_args="${nis_yppasswdd_flags}"
;;
NetBSD)
rcvar=$name
required_vars="rpcbind ypserv"
;;
esac
rcvar="nis_yppasswdd_enable"
command_args="${nis_yppasswdd_flags}"
yppasswdd_precmd()
{
case ${OSTYPE} in
FreeBSD)
if ! checkyesno rpcbind_enable && \
! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
then
force_depend rpcbind || return 1
fi
if ! checkyesno nis_server_enable && \
! /etc/rc.d/ypserv forcestatus 1>/dev/null 2>&1
then
force_depend ypserv || return 1
fi
;;
esac
if ! checkyesno rpcbind_enable && \
! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
then
force_depend rpcbind || return 1
fi
if ! checkyesno nis_server_enable && \
! /etc/rc.d/ypserv forcestatus 1>/dev/null 2>&1
then
force_depend ypserv || return 1
fi
_domain=`domainname`
if [ -z "$_domain" ]; then
warn "NIS domainname(1) is not set."

View File

@ -15,35 +15,21 @@ command="/usr/sbin/${name}"
start_precmd="ypserv_precmd"
load_rc_config $name
case ${OSTYPE} in
FreeBSD)
rcvar="nis_server_enable"
command_args="${nis_server_flags}"
;;
NetBSD)
rcvar=${name}
required_vars="rpcbind"
;;
esac
rcvar="nis_server_enable"
command_args="${nis_server_flags}"
ypserv_precmd()
{
case ${OSTYPE} in
FreeBSD)
if ! checkyesno rpcbind_enable && \
! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
then
force_depend rpcbind || return 1
fi
;;
esac
if ! checkyesno rpcbind_enable && \
! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
then
force_depend rpcbind || return 1
fi
_domain=`domainname`
if [ -z "$_domain" ]; then
warn "NIS domainname(1) is not set."
return 1
fi
if [ ! -d /var/yp/$_domain/. ]; then
warn "/var/yp/$_domain is not a directory."
return 1