rc.subr: - introduce "depvar", which warns about using deprecated variables instead of silently doing so. I added this because I didn't have rpcbind_enable in rc.conf so thought that I was testing the dependency startup, but wasn't because I had portmap_enable. This is WIP and may just get removed again, since the warnings trigger too often (e.g. /etc/rc.d/sysctl: WARNING: Overriding mountd_enable (NO) with deprecated single_mountd_enable (YES) /etc/rc.d/sysctl: WARNING: Overriding ntpd_enable (NO) with deprecated xntpd_enable (YES) -- why should sysctl care about those variables?) - introduce "check_force_depend_script", which can be used to check if a dependency is configured and/or running, and force it if not. This replaces the same 5 lines repeated in every script that depended on rpcbind. - Use "-r" instead of "-f" for "is the pid file readable" check. - More verbose debugging in run_rc_command General cleanups: - Make sure that "rcvar" (more or less) works on every script - this was an attempt to make sure that the scripts check their arguments instead of just starting up when invoked. - Replace repeated code with check_force_depend Specific changes of note: - Move osf1 and ibcs2 from archdep to abi - Move xtend from archdep to its own rc file Need help checking: - diskless - atm Note the use of "-w -b" in the diffs; this means the indentation looks funny in the patched files since I often reindented a whole file to add a foo_start(){} wrapper. The committed patches will have proper indentation. Index: ../rc.subr =================================================================== RCS file: /home/ncvs/src/etc/rc.subr,v retrieving revision 1.6 diff -u -w -b -r1.6 rc.subr --- ../rc.subr 12 Sep 2002 17:27:36 -0000 1.6 +++ ../rc.subr 1 Nov 2002 23:01:15 -0000 @@ -93,6 +93,41 @@ } # +# check_force_depend script [rcvar] +# Check rcvar; if it's off, check if the service is running; +# if not, force_depend the script. +# $1 - filename of script, in /etc/rc.d, to run +# $2 - optional rc variable +# $3 - "NO" to only check the variable and not run forcestatus +# +check_force_depend() +{ + _depend="$1" + + if [ -n "$2" ] + then + debug "check_force_depend: checking $2 for $1" + if checkyesno $2 + then + # It's enabled, so it must be running. + return 0 + fi + fi + + if [ "X$3" != "XNO" ] + then + debug "check_force_depend: checking status for $1" + if /etc/rc.d/${_depend} forcestatus 1>/dev/null 2>&1 + then + # It's running. + return 0 + fi + fi + + force_depend ${_depend} || return 1 +} + +# # force_depend script # Force a service to start. Intended for use by services # to resolve dependency issues. It is assumed the caller @@ -189,7 +224,7 @@ if [ -z "$_pidfile" -o -z "$_procname" ]; then err 3 'USAGE: check_pidfile pidfile procname [interpreter]' fi - if [ ! -f $_pidfile ]; then + if [ ! -r $_pidfile ]; then debug "pid file {$_pidfile): not readable." return fi @@ -532,15 +567,17 @@ eval _cmd=\$${rc_arg}_cmd _precmd=\$${rc_arg}_precmd \ _postcmd=\$${rc_arg}_postcmd if [ -n "$_cmd" ]; then - debug "run_rc_command: using XXX_cmd functions." + debug "run_rc_command: using XXX_cmd functions for $name." # if the precmd failed and force # isn't set, exit # if ! eval $_precmd && [ -z "$rc_force" ]; then + debug "run_rc_command: precmd failed" return 1 fi if ! eval $_cmd && [ -z "$rc_force" ]; then + debug "run_rc_command: cmd failed" return 1 fi eval $_postcmd @@ -601,6 +638,7 @@ # isn't set, exit # if ! eval $_precmd && [ -z "$rc_force" ]; then + debug "run_rc_command: precmd failed" return 1 fi @@ -627,6 +665,7 @@ # debug "run_rc_command: _doit: $_doit" if ! eval $_doit && [ -z "$rc_force" ]; then + debug "run_rc_command: _doit failed" return 1 fi @@ -650,6 +689,7 @@ # isn't set, exit # if ! eval $_precmd && [ -z "$rc_force" ]; then + debug "run_rc_command: precmd failed" return 1 fi @@ -665,6 +705,7 @@ # isn't set, exit # if ! eval $_doit && [ -z "$rc_force" ]; then + debug "run_rc_command: _doit failed" return 1 fi @@ -820,16 +861,46 @@ # case ${OSTYPE} in FreeBSD) - [ -n "$portmap_enable" ] && rpcbind_enable="$portmap_enable" - [ -n "$portmap_program" ] && rpcbind_program="$portmap_program" - [ -n "$portmap_flags" ] && rpcbind_flags="$portmap_flags" - [ -n "$single_mountd_enable" ] && mountd_enable="$single_mountd_enable" - [ -n "$xntpd_enable" ] && ntpd_enable="$xntpd_enable" - [ -n "$xntpd_program" ] && ntpd_program="$xntpd_program" - [ -n "$xntpd_flags" ] && ntpd_flags="$xntpd_flags" + depvar portmap_enable rpcbind_enable + depvar portmap_program rpcbind_program + depvar portmap_flags rpcbind_flags + depvar single_mountd_enable mountd_enable + depvar xntpd_enable ntpd_enable + depvar xntpd_program ntpd_program + depvar xntpd_flags ntpd_flags ;; esac +} + +# depvar +# Allow backwards compatability in rc.conf variable names. +# $1 - deprecated variable name +# $2 - new variable name +# +# XXX todo - set warned about state +depvar() +{ + _oldvar="$1" + _newvar="$2" + eval "_oldval=\"\$$_oldvar\"" + if [ -n "$_oldval" ] + then + eval "_newval=\"\$$_newvar\"" + eval "_warned=\"\${_warned_${_oldvar}}\"" +# if [ -z "$_warned" ] +# then +# eval "_warned_${_oldvar}=1" + if [ "$_newval" != "$_oldval" ] + then + warn "Overriding ${_newvar} (${_newval}) with deprecated ${_oldvar} (${_oldval})" + eval "${_newvar}=\"\$$_oldvar\"" + else + info "Deprecated ${_oldvar} present, please replace with ${_newvar}" + fi + eval "${_oldvar}=\"\"" + fi +# fi } # Index: Makefile =================================================================== RCS file: /home/ncvs/src/etc/rc.d/Makefile,v retrieving revision 1.8 diff -u -w -b -r1.8 Makefile --- Makefile 6 Sep 2002 01:23:31 -0000 1.8 +++ Makefile 31 Oct 2002 23:07:23 -0000 @@ -13,8 +13,8 @@ network3 network_ipv6 nfsclient nfsd nfslocking nfsserver ntpd \ ntpdate othermta pccard pcvt ppp-user pppoed pwcheck quota random \ rarpd root route6d routed rpcbind rtadvd rwho savecore \ - securelevel sendmail serial sppp sshd swap1 syscons sysctl \ - syslogd timed ttys usbd vinum virecover ypbind yppasswdd ypserv \ + securelevel sendmail serial sppp sshd swap1 syscons sysctl sysctl-last \ + syslogd timed ttys usbd vinum virecover xtend ypbind yppasswdd ypserv \ ypset ypupdated ypxfrd FILESDIR= /etc/rc.d FILESMODE= ${BINMODE} Index: abi =================================================================== RCS file: /home/ncvs/src/etc/rc.d/abi,v retrieving revision 1.1 diff -u -w -b -r1.1 abi --- abi 13 Jun 2002 22:14:36 -0000 1.1 +++ abi 31 Oct 2002 23:05:08 -0000 @@ -9,11 +9,19 @@ . /etc/rc.subr +abibanner=0 +abi_banner() { + if [ $abibanner -eq 0 ] + then echo -n 'Additional ABI support:' + fi + abibanner=1 +} name="sysvipc" rcvar=`set_rcvar` start_cmd="sysv_start" +start_precmd="abi_banner" stop_cmd=":" sysv_start() @@ -45,10 +53,44 @@ name="svr4" rcvar=`set_rcvar` -start_precmd="echo -n ' svr4'" +start_precmd="abi_banner; echo -n ' svr4'" start_cmd="kldload svr4 > /dev/null 2>&1" load_rc_config $name run_rc_command "$1" +name="osf1" +rcvar=`set_rcvar` +start_precmd="abi_banner; echo -n ' OSF/1'" +start_cmd="kldload osf1 > /dev/null 2>&1" + +load_rc_config $name +run_rc_command "$1" + +name="ibcs2" +rcvar=`set_rcvar` +start_precmd="abi_banner" +start_cmd="ibcs2_start" + +ibcs2_start() +{ + echo -n ' ibcs2' + kldload ibcs2 > /dev/null 2>&1 + case ${ibcs2_loaders} in + [Nn][Oo]) + ;; + *) + for i in ${ibcs2_loaders}; do + kldload ibcs2_$i > /dev/null 2>&1 + done + ;; + esac +} + +load_rc_config $name +run_rc_command "$1" + +if [ $abibanner -eq 1 ] +then echo '.' +fi Index: amd =================================================================== RCS file: /home/ncvs/src/etc/rc.d/amd,v retrieving revision 1.9 diff -u -w -b -r1.9 amd --- amd 12 Oct 2002 10:31:31 -0000 1.9 +++ amd 1 Nov 2002 18:54:36 -0000 @@ -32,15 +32,8 @@ { case ${OSTYPE} in FreeBSD) - if ! checkyesno nfs_client_enable; then - force_depend nfsclient || return 1 - fi - - if ! checkyesno rpcbind_enable && \ - ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1 - then - force_depend rpcbind || return 1 - fi + check_force_depend nfsclient nfs_client_enable NO || return 1 + check_force_depend rpcbind rpcbind_enable || return 1 case ${amd_map_program} in [Nn][Oo] | '') Index: archdep =================================================================== RCS file: /home/ncvs/src/etc/rc.d/archdep,v retrieving revision 1.2 diff -u -w -b -r1.2 archdep --- archdep 12 Oct 2002 10:31:31 -0000 1.2 +++ archdep 31 Oct 2002 23:06:42 -0000 @@ -11,7 +11,7 @@ . /etc/rc.subr name=archdep -load_rc_config $name +start_cmd="archdep_start" # should we print out unaligned access warnings? # @@ -22,56 +22,15 @@ fi } -# Alpha OSF/1 binary emulation -# -osf1_compat() -{ - if checkyesno osf1_enable; then - echo -n ' OSF/1' - if ! kldstat -v | grep osf1_ecoff > /dev/null; then - kldload osf1 > /dev/null 2>&1 - fi - fi -} -# SCO binary emulation -# -ibcs2_compat() +archdep_start() { - if checkyesno ibcs2_enable; then - echo -n ' ibcs2' - kldload ibcs2 > /dev/null 2>&1 - case ${ibcs2_loaders} in - [Nn][Oo]) - ;; - *) - for i in ${ibcs2_loaders}; do - kldload ibcs2_$i > /dev/null 2>&1 - done - ;; - esac - fi -} - -# X-10 Daemon -# -x10_daemon() -{ - if checkyesno xtend_enable; then - echo -n ' xtend' - /usr/libexec/xtend - fi -} - _arch=`${SYSCTL_N} hw.machine` echo -n "Initial $_arch initialization:" case $_arch in i386) - ibcs2_compat - x10_daemon ;; alpha) - osf1_compat unaligned_warnings ;; ia64) @@ -79,3 +38,7 @@ ;; esac echo '.' +} + +load_rc_config $name +run_rc_command "$1" Index: atm2.sh =================================================================== RCS file: /home/ncvs/src/etc/rc.d/atm2.sh,v retrieving revision 1.11 diff -u -w -b -r1.11 atm2.sh --- atm2.sh 12 Oct 2002 10:31:31 -0000 1.11 +++ atm2.sh 1 Nov 2002 23:18:21 -0000 @@ -95,10 +95,10 @@ export atm_scspd } -load_rc_config "XXX" +load_rc_config "atm" -case ${atm_enable} in -[Yy][Ee][Ss]) +case ${atm_enable}$1 in +[Yy][Ee][Ss]start) atm2_start ;; esac Index: atm3.sh =================================================================== RCS file: /home/ncvs/src/etc/rc.d/atm3.sh,v retrieving revision 1.10 diff -u -w -b -r1.10 atm3.sh --- atm3.sh 13 Jun 2002 22:14:36 -0000 1.10 +++ atm3.sh 1 Nov 2002 23:15:22 -0000 @@ -59,10 +59,10 @@ echo '.' } -load_rc_config "XXX" +load_rc_config "atm" -case ${atm_enable} in -[Yy][Ee][Ss]) +case ${atm_enable}$1 in +[Yy][Ee][Ss]start) atm3_start ;; esac Index: cleanvar =================================================================== RCS file: /home/ncvs/src/etc/rc.d/cleanvar,v retrieving revision 1.2 diff -u -w -b -r1.2 cleanvar --- cleanvar 12 Oct 2002 10:31:31 -0000 1.2 +++ cleanvar 31 Oct 2002 21:40:32 -0000 @@ -8,6 +8,12 @@ # BEFORE: network1 # KEYWORD: FreeBSD +. /etc/rc.subr + +name="cleanvar" +start_cmd="cleanvar_start" +stop_cmd=":" + purgedir() { local dir file @@ -33,6 +39,8 @@ fi } +cleanvar_start() +{ rm -f /var/run/clean_var /var/spool/lock/clean_var if [ -d /var/run -a ! -f /var/run/clean_var ]; then purgedir /var/run @@ -45,4 +53,7 @@ >/var/spool/lock/clean_var fi rm -rf /var/spool/uucp/.Temp/* +} +load_rc_config $name +run_rc_command "$1" Index: devdb =================================================================== RCS file: /home/ncvs/src/etc/rc.d/devdb,v retrieving revision 1.2 diff -u -w -b -r1.2 devdb --- devdb 12 Oct 2002 10:31:31 -0000 1.2 +++ devdb 31 Oct 2002 22:25:18 -0000 @@ -7,6 +7,14 @@ # REQUIRE: syslogd # KEYWORD: FreeBSD +. /etc/rc.subr + +name="devdb" +start_cmd="devdb_start" +stop_cmd=":" + +devdb_start() +{ # Build device name databases if we are not using DEVFS # if sysctl vfs.devfs.generation > /dev/null 2>&1; then @@ -14,4 +22,7 @@ else dev_mkdb fi +} +load_rc_config $name +run_rc_command "$1" Index: devfs =================================================================== RCS file: /home/ncvs/src/etc/rc.d/devfs,v retrieving revision 1.1 diff -u -w -b -r1.1 devfs --- devfs 13 Jun 2002 22:14:36 -0000 1.1 +++ devfs 31 Oct 2002 22:05:08 -0000 @@ -10,10 +10,15 @@ . /etc/rc.subr name="devfs" +start_cmd="devfs_start" +stop_cmd=":" -load_rc_config $name - +devfs_start() +{ # Setup DEVFS, ie permissions, links etc. # ln -fs /dev/ttyv0 /dev/vga +} +load_rc_config $name +run_rc_command "$1" Index: diskless =================================================================== RCS file: /home/ncvs/src/etc/rc.d/diskless,v retrieving revision 1.23 diff -u -w -b -r1.23 diskless --- diskless 12 Oct 2002 10:31:31 -0000 1.23 +++ diskless 1 Nov 2002 00:09:48 -0000 @@ -32,10 +32,15 @@ # BEFORE: addswap random # KEYWORD: FreeBSD -dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null` -[ ${dlv:=0} -eq 0 ] && exit 0 +name="diskless" +start_cmd="diskless_start" +start_precmd="diskless_precmd" +stop_cmd=":" -name="diskless2" +diskless_precmd() { + dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null` + [ ${dlv:=0} -eq 0 ] && return 1 +} # Provide a function for normalizing the mounting of memory # filesystems. This should allow the rest of the code here to remain @@ -64,6 +69,8 @@ . /etc/rc.conf fi +diskless_start() +{ echo "+++ mount_md of /var" mount_md ${varsize:=32m} /var 1 @@ -117,3 +124,7 @@ mount_md 4096 /dev 3 512 (cd /; cpio -i -H newc -d < /tmp/dev.tmp) fi +} + +load_rc_config $name +run_rc_command "$1" Index: initdiskless =================================================================== RCS file: /home/ncvs/src/etc/rc.d/initdiskless,v retrieving revision 1.21 diff -u -w -b -r1.21 initdiskless --- initdiskless 12 Oct 2002 10:31:31 -0000 1.21 +++ initdiskless 1 Nov 2002 00:10:04 -0000 @@ -30,8 +30,17 @@ # PROVIDE: initdiskless # KEYWORD: FreeBSD +. /etc/rc.subr + +name="initdiskless" +start_cmd="initdiskless_start" +start_precmd="initdiskless_precmd" +stop_cmd=":" + +initdiskless_precmd() { dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null` -[ ${dlv:=0} -eq 0 ] && exit 0 + [ ${dlv:=0} -eq 0 ] && return 1 +} # # BOOTP has mounted / for us. Assume a read-only mount. We must then @@ -74,6 +83,8 @@ # # set -v +initdiskless_start() +{ # Figure out our interface and IP. # bootp_ifc="" @@ -140,3 +151,7 @@ fi exit 2 # Tell /etc/rc to re-source rc.conf +} + +load_rc_config $name +run_rc_command "$1" Index: keyserv =================================================================== RCS file: /home/ncvs/src/etc/rc.d/keyserv,v retrieving revision 1.2 diff -u -w -b -r1.2 keyserv --- keyserv 14 Aug 2002 05:44:32 -0000 1.2 +++ keyserv 1 Nov 2002 18:49:47 -0000 @@ -20,11 +20,7 @@ keyserv_prestart() { - if ! checkyesno rpcbind_enable && \ - ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1 - then - force_depend rpcbind || return 1 - fi + check_force_depend rpcbind rpcbind_enable || return 1 return 0 } Index: mountd =================================================================== RCS file: /home/ncvs/src/etc/rc.d/mountd,v retrieving revision 1.9 diff -u -w -b -r1.9 mountd --- mountd 12 Oct 2002 10:31:31 -0000 1.9 +++ mountd 1 Nov 2002 18:54:54 -0000 @@ -21,11 +21,7 @@ { 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 + check_force_depend rpcbind rpcbind_enable || return 1 # mountd flags will differ depending on rc.conf settings # Index: msgs =================================================================== RCS file: /home/ncvs/src/etc/rc.d/msgs,v retrieving revision 1.1 diff -u -w -b -r1.1 msgs --- msgs 13 Jun 2002 22:14:36 -0000 1.1 +++ msgs 31 Oct 2002 22:35:33 -0000 @@ -7,8 +7,20 @@ # REQUIRE: LOGIN # KEYWORD: FreeBSD +. /etc/rc.subr + +name="msgs" +start_cmd="start_msgs" +stop_cmd=":" + +start_msgs() +{ # Make a bounds file for msgs(1) if there isn't one already # if [ -d /var/msgs -a ! -f /var/msgs/bounds -a ! -L /var/msgs/bounds ]; then echo 0 > /var/msgs/bounds fi +} + +load_rc_config $name +run_rc_command "$1" Index: network1 =================================================================== RCS file: /home/ncvs/src/etc/rc.d/network1,v retrieving revision 1.142 diff -u -w -b -r1.142 network1 --- network1 12 Oct 2002 10:31:31 -0000 1.142 +++ network1 31 Oct 2002 21:35:11 -0000 @@ -1,4 +1,4 @@ -#!/bin/sh -x +#!/bin/sh # # $FreeBSD: src/etc/rc.d/network1,v 1.142 2002/10/12 10:31:31 schweikh Exp $ # Index: network3 =================================================================== RCS file: /home/ncvs/src/etc/rc.d/network3,v retrieving revision 1.136 diff -u -w -b -r1.136 network3 --- network3 12 Oct 2002 10:31:31 -0000 1.136 +++ network3 31 Oct 2002 21:37:34 -0000 @@ -9,8 +9,12 @@ . /etc/rc.subr -load_rc_config 'XXX' +name="network3" +start_cmd="network3_start" +stop_cmd=":" +network3_start() +{ echo -n 'Additional TCP options:' case ${log_in_vain} in [Nn][Oo] | '') @@ -33,3 +37,7 @@ sysctl net.inet.udp.log_in_vain="${log_in_vain}" >/dev/null ) echo '.' +} + +load_rc_config $name +run_rc_command "$1" Index: network_ipv6 =================================================================== RCS file: /home/ncvs/src/etc/rc.d/network_ipv6,v retrieving revision 1.32 diff -u -w -b -r1.32 network_ipv6 --- network_ipv6 12 Oct 2002 10:31:31 -0000 1.32 +++ network_ipv6 31 Oct 2002 21:43:24 -0000 @@ -32,6 +32,8 @@ # REQUIRE: network2 # KEYWORD: FreeBSD +. /etc/rc.subr + name="network_ipv6" rcvar=`set_rcvar ipv6` start_cmd="network_ipv6_start" Index: nfsd =================================================================== RCS file: /home/ncvs/src/etc/rc.d/nfsd,v retrieving revision 1.8 diff -u -w -b -r1.8 nfsd --- nfsd 12 Oct 2002 10:31:31 -0000 1.8 +++ nfsd 1 Nov 2002 18:51:02 -0000 @@ -32,17 +32,8 @@ 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 + check_force_depend rpcbind rpcbind_enable || return 1 + check_force_depend mountd mountd_enable || return 1 if checkyesno nfs_reserved_port_only; then echo 'NFS on reserved port only=YES' Index: sysctl-last =================================================================== RCS file: sysctl-last diff -N sysctl-last --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sysctl-last 31 Oct 2002 23:27:44 -0000 @@ -0,0 +1,18 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: sysctl-last +# BEFORE: securelevel +# KEYWORD: FreeBSD + +. /etc/rc.subr + +name="sysctl-last" +stop_cmd=":" +start_cmd="/etc/rc.d/sysctl lastload" +reload_cmd="/etc/rc.d/sysctl lastload" + +load_rc_config $name +run_rc_command "$1" Index: xtend =================================================================== RCS file: xtend diff -N xtend --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ xtend 31 Oct 2002 23:05:07 -0000 @@ -0,0 +1,16 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: xtend +# REQUIRE: DAEMON +# KEYWORD: FreeBSD + +. /etc/rc.subr + +name="xtend" +rcvar=`set_rcvar` + +load_rc_config $name +run_rc_command "$1" Index: ypbind =================================================================== RCS file: /home/ncvs/src/etc/rc.d/ypbind,v retrieving revision 1.3 diff -u -w -b -r1.3 ypbind --- ypbind 6 Sep 2002 16:18:05 -0000 1.3 +++ ypbind 1 Nov 2002 18:41:39 -0000 @@ -32,6 +32,7 @@ warn "domainname(1) is not set." return 1 fi + check_force_depend rpcbind rpcbind_enable || return 1 } load_rc_config $name Index: yppasswdd =================================================================== RCS file: /home/ncvs/src/etc/rc.d/yppasswdd,v retrieving revision 1.4 diff -u -w -b -r1.4 yppasswdd --- yppasswdd 6 Sep 2002 16:18:05 -0000 1.4 +++ yppasswdd 1 Nov 2002 18:53:48 -0000 @@ -30,16 +30,8 @@ { 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 + check_force_depend rpcbind rpcbind_enable || return 1 + check_force_depend ypserv nis_server_enable || return 1 ;; esac Index: ypserv =================================================================== RCS file: /home/ncvs/src/etc/rc.d/ypserv,v retrieving revision 1.5 diff -u -w -b -r1.5 ypserv --- ypserv 12 Oct 2002 10:31:31 -0000 1.5 +++ ypserv 1 Nov 2002 18:41:38 -0000 @@ -29,11 +29,7 @@ { 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 + check_force_depend rpcbind rpcbind_enable || return 1 ;; esac Index: ypset =================================================================== RCS file: /home/ncvs/src/etc/rc.d/ypset,v retrieving revision 1.3 diff -u -w -b -r1.3 ypset --- ypset 12 Oct 2002 10:31:31 -0000 1.3 +++ ypset 1 Nov 2002 18:52:27 -0000 @@ -17,16 +17,8 @@ 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 + check_force_depend rpcbind rpcbind_enable || return 1 + check_force_depend ypbind nis_client_enable || return 1 _domain=`domainname` if [ -z "$_domain" ]; then Index: ypupdated =================================================================== RCS file: /home/ncvs/src/etc/rc.d/ypupdated,v retrieving revision 1.3 diff -u -w -b -r1.3 ypupdated --- ypupdated 12 Oct 2002 10:31:31 -0000 1.3 +++ ypupdated 1 Nov 2002 18:52:54 -0000 @@ -16,16 +16,9 @@ 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 + + check_force_depend rpcbind rpcbind_enable || return 1 + check_force_depend ypserv nis_server_enable || return 1 _domain=`domainname` if [ -z "$_domain" ]; then Index: ypxfrd =================================================================== RCS file: /home/ncvs/src/etc/rc.d/ypxfrd,v retrieving revision 1.3 diff -u -w -b -r1.3 ypxfrd --- ypxfrd 12 Oct 2002 10:31:31 -0000 1.3 +++ ypxfrd 1 Nov 2002 18:53:16 -0000 @@ -17,16 +17,8 @@ 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 + check_force_depend rpcbind rpcbind_enable || return 1 + check_force_depend ypserv nis_server_enable || return 1 _domain=`domainname` if [ -z "$_domain" ]; then