From 008b9b25ad2ce5dc5898051a4b7473c537da8d1b Mon Sep 17 00:00:00 2001 From: gordon Date: Wed, 14 Aug 2002 05:44:32 +0000 Subject: 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 --- etc/rc.d/amd | 2 +- etc/rc.d/keyserv | 13 ++++++++++++- etc/rc.d/mountd | 16 ++-------------- etc/rc.d/nfsd | 13 ++++++++++++- etc/rc.d/ntpd | 15 ++++++--------- etc/rc.d/rpcbind | 17 +++-------------- etc/rc.d/yppasswdd | 16 +++++++++++++++- etc/rc.d/ypserv | 11 ++++++++++- etc/rc.d/ypset | 12 +++++++++++- etc/rc.d/ypupdated | 12 +++++++++++- etc/rc.d/ypxfrd | 12 +++++++++++- etc/rc.network | 12 ++++++------ 12 files changed, 100 insertions(+), 51 deletions(-) (limited to 'etc') diff --git a/etc/rc.d/amd b/etc/rc.d/amd index 9faa86a..971a1e7 100755 --- a/etc/rc.d/amd +++ b/etc/rc.d/amd @@ -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 diff --git a/etc/rc.d/keyserv b/etc/rc.d/keyserv index 2f46908..4419426 100644 --- a/etc/rc.d/keyserv +++ b/etc/rc.d/keyserv @@ -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" diff --git a/etc/rc.d/mountd b/etc/rc.d/mountd index 6f0fe86..7de831b 100755 --- a/etc/rc.d/mountd +++ b/etc/rc.d/mountd @@ -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 diff --git a/etc/rc.d/nfsd b/etc/rc.d/nfsd index cf946ff..0e05830 100755 --- a/etc/rc.d/nfsd +++ b/etc/rc.d/nfsd @@ -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 diff --git a/etc/rc.d/ntpd b/etc/rc.d/ntpd index 81671a1..fa1726e 100755 --- a/etc/rc.d/ntpd +++ b/etc/rc.d/ntpd @@ -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 diff --git a/etc/rc.d/rpcbind b/etc/rc.d/rpcbind index 191d6de..a11da1f 100755 --- a/etc/rc.d/rpcbind +++ b/etc/rc.d/rpcbind @@ -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" diff --git a/etc/rc.d/yppasswdd b/etc/rc.d/yppasswdd index 3cb98076..13928f3 100755 --- a/etc/rc.d/yppasswdd +++ b/etc/rc.d/yppasswdd @@ -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." diff --git a/etc/rc.d/ypserv b/etc/rc.d/ypserv index 99c8d9d..29ec316 100755 --- a/etc/rc.d/ypserv +++ b/etc/rc.d/ypserv @@ -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." diff --git a/etc/rc.d/ypset b/etc/rc.d/ypset index 175a634..577b545 100644 --- a/etc/rc.d/ypset +++ b/etc/rc.d/ypset @@ -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." diff --git a/etc/rc.d/ypupdated b/etc/rc.d/ypupdated index 1b3e2b1..6e8b193 100644 --- a/etc/rc.d/ypupdated +++ b/etc/rc.d/ypupdated @@ -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." diff --git a/etc/rc.d/ypxfrd b/etc/rc.d/ypxfrd index 9b32532..cf873fb 100644 --- a/etc/rc.d/ypxfrd +++ b/etc/rc.d/ypxfrd @@ -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." diff --git a/etc/rc.network b/etc/rc.network index febaf83..95f92a4 100644 --- a/etc/rc.network +++ b/etc/rc.network @@ -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]) -- cgit v1.1