mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 10:19:26 +00:00
Clean up the scripts to use the new variables:
xntpd_* -> ntpd_* portmap_* -> rpcbind_* Also change single_mountd_enable -> mountd_enable Changing the mountd flags brings us closer to NetBSD. All of the old variable names are shimmed so you can continue to use the old variable name. Finally make /etc/rc.d/mountd no longer dependent on nfs as there are (apparently) other consumers of mountd. Submitted by: Mike Makonnen <makonnen@pacbell.net>
This commit is contained in:
parent
2ee93c5780
commit
88f7d3e22b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=101851
@ -36,7 +36,7 @@ amd_precmd()
|
||||
force_depend nfsclient || return 1
|
||||
fi
|
||||
|
||||
if ! checkyesno portmap_enable && \
|
||||
if ! checkyesno rpcbind_enable && \
|
||||
! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
|
||||
then
|
||||
force_depend rpcbind || return 1
|
||||
|
@ -16,7 +16,18 @@
|
||||
name="keyserv"
|
||||
rcvar=`set_rcvar`
|
||||
command="/usr/sbin/${name}"
|
||||
required_vars="portmap_enable"
|
||||
start_precmd="keyserv_prestart"
|
||||
|
||||
keyserv_prestart()
|
||||
{
|
||||
if ! checkyesno rpcbind_enable && \
|
||||
! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
|
||||
then
|
||||
force_depend rpcbind || return 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
load_rc_config $name
|
||||
run_rc_command "$1"
|
||||
|
@ -11,29 +11,17 @@
|
||||
. /etc/rc.subr
|
||||
|
||||
name="mountd"
|
||||
rcvar=`set_rcvar`
|
||||
command="/usr/sbin/${name}"
|
||||
required_files="/etc/exports"
|
||||
start_precmd="mountd_precmd"
|
||||
extra_commands="reload"
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
FreeBSD)
|
||||
rcvar=`set_rcvar nfs_server`
|
||||
;;
|
||||
NetBSD)
|
||||
rcvar=`set_rcvar`
|
||||
;;
|
||||
esac
|
||||
|
||||
mountd_precmd()
|
||||
{
|
||||
case `${CMD_OSTYPE}` in
|
||||
FreeBSD)
|
||||
if ! sysctl vfs.nfsrv >/dev/null 2>&1; then
|
||||
force_depend nfsserver || return 1
|
||||
fi
|
||||
|
||||
if ! checkyesno portmap_enable && \
|
||||
if ! checkyesno rpcbind_enable && \
|
||||
! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
|
||||
then
|
||||
force_depend rpcbind || return 1
|
||||
|
@ -17,7 +17,6 @@ command="/usr/sbin/${name}"
|
||||
case `${CMD_OSTYPE}` in
|
||||
FreeBSD)
|
||||
command_args="${nfs_server_flags}"
|
||||
required_vars="portmap_enable"
|
||||
start_precmd="nfsd_precmd"
|
||||
;;
|
||||
NetBSD)
|
||||
@ -32,6 +31,18 @@ nfsd_precmd()
|
||||
force_depend nfsserver || return 1
|
||||
fi
|
||||
|
||||
if ! checkyesno rpcbind_enable && \
|
||||
! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
|
||||
then
|
||||
force_depend rpcbind || return 1
|
||||
fi
|
||||
|
||||
if ! checkyesno mountd_enable && \
|
||||
! /etc/rc.d/mountd forcestatus 1>/dev/null 2>&1
|
||||
then
|
||||
force_depend mountd || return 1
|
||||
fi
|
||||
|
||||
if checkyesno nfs_reserved_port_only ; then
|
||||
echo -n ' NFS on reserved port only=YES'
|
||||
sysctl vfs.nfsrv.nfs_privport=1 > /dev/null
|
||||
|
@ -11,21 +11,18 @@
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name=ntpd
|
||||
rcvar=`set_rcvar`
|
||||
command="/usr/sbin/${name}"
|
||||
pidfile="/var/run/${name}.pid"
|
||||
required_files="/etc/ntp.conf"
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
FreeBSD)
|
||||
name="xntpd"
|
||||
;;
|
||||
NetBSD)
|
||||
name="ntpd"
|
||||
start_precmd="ntpd_precmd"
|
||||
;;
|
||||
esac
|
||||
|
||||
rcvar=`set_rcvar`
|
||||
command="/usr/sbin/ntpd"
|
||||
pidfile="/var/run/ntpd.pid"
|
||||
required_files="/etc/ntp.conf"
|
||||
|
||||
ntpd_precmd()
|
||||
{
|
||||
if [ -z "$ntpd_chrootdir" ]; then
|
||||
|
@ -11,25 +11,14 @@
|
||||
. /etc/rc.subr
|
||||
|
||||
name="rpcbind"
|
||||
|
||||
# XXX - Executable may be in a different location. The $name variable
|
||||
# is different from the variable in rc.conf(5) so the
|
||||
# subroutines in rc.subr won't catch it.
|
||||
#
|
||||
load_rc_config $name
|
||||
rcvar=`set_rcvar`
|
||||
command="/usr/sbin/${name}"
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
FreeBSD)
|
||||
pidfile=
|
||||
rcvar="portmap_enable"
|
||||
command="${portmap_program:-/usr/sbin/${name}}"
|
||||
eval ${name}_flags=\"${portmap_flags}\"
|
||||
;;
|
||||
NetBSD)
|
||||
rcvar=$name
|
||||
command="/usr/sbin/${name}"
|
||||
pidfile="/var/run/${name}.pid"
|
||||
;;
|
||||
esac
|
||||
|
||||
load_rc_config $name
|
||||
run_rc_command "$1"
|
||||
|
@ -18,7 +18,6 @@ start_precmd="yppasswdd_precmd"
|
||||
case `${CMD_OSTYPE}` in
|
||||
FreeBSD)
|
||||
rcvar="nis_yppasswdd_enable"
|
||||
required_vars="portmap_enable nis_server_enable"
|
||||
command_args="${nis_yppasswdd_flags}"
|
||||
;;
|
||||
NetBSD)
|
||||
@ -29,6 +28,21 @@ esac
|
||||
|
||||
yppasswdd_precmd()
|
||||
{
|
||||
case `${CMD_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
|
||||
|
||||
_domain=`domainname`
|
||||
if [ -z "$_domain" ]; then
|
||||
warn "domainname(1) is not set."
|
||||
|
@ -17,7 +17,6 @@ start_precmd="ypserv_precmd"
|
||||
case `${CMD_OSTYPE}` in
|
||||
FreeBSD)
|
||||
rcvar="nis_server_enable"
|
||||
required_vars="portmap_enable"
|
||||
command_args="${nis_server_flags}"
|
||||
;;
|
||||
NetBSD)
|
||||
@ -28,6 +27,16 @@ esac
|
||||
|
||||
ypserv_precmd()
|
||||
{
|
||||
case `${CMD_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
|
||||
|
||||
_domain=`domainname`
|
||||
if [ -z "$_domain" ]; then
|
||||
warn "domainname(1) is not set."
|
||||
|
@ -13,11 +13,21 @@ name="ypset"
|
||||
rcvar="nis_ypset_enable"
|
||||
command="/usr/sbin/${name}"
|
||||
command_args="${nis_ypset_flags}"
|
||||
required_vars="portmap_enable nis_client_enable"
|
||||
start_precmd="ypset_precmd"
|
||||
|
||||
ypset_precmd()
|
||||
{
|
||||
if ! checkyesno rpcbind_enable && \
|
||||
! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
|
||||
then
|
||||
force_depend rpcbind || return 1
|
||||
fi
|
||||
if ! checkyesno nis_client_enable && \
|
||||
! /etc/rc.d/ypbind forcestatus 1>/dev/null 2>&1
|
||||
then
|
||||
force_depend ypbind || return 1
|
||||
fi
|
||||
|
||||
_domain=`domainname`
|
||||
if [ -z "$_domain" ]; then
|
||||
warn "domainname(1) is not set."
|
||||
|
@ -12,11 +12,21 @@
|
||||
name="ypupdated"
|
||||
rcvar="rpc_ypupdated_enable"
|
||||
command="/usr/sbin/rpc.${name}"
|
||||
required_vars="portmap_enable nis_server_enable"
|
||||
start_precmd="rpc_ypupdated_precmd"
|
||||
|
||||
rpc_ypupdated_precmd()
|
||||
{
|
||||
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 "domainname(1) is not set."
|
||||
|
@ -13,11 +13,21 @@ name="ypxfrd"
|
||||
rcvar="nis_ypxfrd_enable"
|
||||
command="/usr/sbin/rpc.${name}"
|
||||
command_args="${nis_ypxfrd_flags}"
|
||||
required_vars="portmap_enable nis_server_enable"
|
||||
start_precmd="ypxfrd_precmd"
|
||||
|
||||
ypxfrd_precmd()
|
||||
{
|
||||
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 "domainname(1) is not set."
|
||||
|
@ -561,9 +561,9 @@ network_pass2() {
|
||||
;;
|
||||
esac
|
||||
|
||||
case ${xntpd_enable} in
|
||||
case ${ntpd_enable} in
|
||||
[Yy][Ee][Ss])
|
||||
echo -n ' ntpd'; ${xntpd_program:-ntpd} ${xntpd_flags}
|
||||
echo -n ' ntpd'; ${ntpd_program:-ntpd} ${ntpd_flags}
|
||||
;;
|
||||
esac
|
||||
|
||||
@ -573,10 +573,10 @@ network_pass2() {
|
||||
;;
|
||||
esac
|
||||
|
||||
case ${portmap_enable} in
|
||||
case ${rpcbind_enable} in
|
||||
[Yy][Ee][Ss])
|
||||
echo -n ' rpcbind'; ${portmap_program:-/usr/sbin/rpcbind} \
|
||||
${portmap_flags}
|
||||
echo -n ' rpcbind'; ${rpcbind_program:-/usr/sbin/rpcbind} \
|
||||
${rpcbind_flags}
|
||||
|
||||
# Start ypserv if we're an NIS server.
|
||||
# Run rpc.ypxfrd and rpc.yppasswdd only on the NIS master server.
|
||||
@ -645,7 +645,7 @@ network_pass2() {
|
||||
network_pass3() {
|
||||
echo -n 'Starting final network daemons:'
|
||||
|
||||
case ${portmap_enable} in
|
||||
case ${rpcbind_enable} in
|
||||
[Yy][Ee][Ss])
|
||||
case ${nfs_server_enable} in
|
||||
[Yy][Ee][Ss])
|
||||
|
Loading…
Reference in New Issue
Block a user