diff options
| author | Yaroslav Tykhiy <ytykhiy@gmail.com> | 2006-12-30 22:53:20 +0000 | 
|---|---|---|
| committer | Yaroslav Tykhiy <ytykhiy@gmail.com> | 2006-12-30 22:53:20 +0000 | 
| commit | 45da9952e505c2defec11d35a8fab56135b82bcd (patch) | |
| tree | 48f5b2fe4337977e994033a03ecdb0d82ffe59a6 | |
| parent | 574c45c445a5ef97978d68eb5fe6514fd6b8006d (diff) | |
Notes
| -rw-r--r-- | etc/rc.d/abi | 2 | ||||
| -rwxr-xr-x | etc/rc.d/accounting | 2 | ||||
| -rw-r--r-- | etc/rc.d/archdep | 2 | ||||
| -rw-r--r-- | etc/rc.d/bluetooth | 4 | ||||
| -rwxr-xr-x | etc/rc.d/bootconf.sh | 6 | ||||
| -rw-r--r-- | etc/rc.d/bridge | 16 | ||||
| -rwxr-xr-x | etc/rc.d/ldconfig | 2 | ||||
| -rwxr-xr-x | etc/rc.d/lpd | 4 | ||||
| -rw-r--r-- | etc/rc.d/moused | 18 | ||||
| -rw-r--r-- | etc/rc.d/netif | 19 | ||||
| -rw-r--r-- | etc/rc.d/nsswitch | 2 | ||||
| -rw-r--r-- | etc/rc.d/pppoed | 2 | ||||
| -rwxr-xr-x | etc/rc.d/syslogd | 16 | ||||
| -rw-r--r-- | etc/rc.d/var | 8 | ||||
| -rwxr-xr-x | etc/rc.d/ypbind | 2 | ||||
| -rwxr-xr-x | etc/rc.d/yppasswdd | 2 | ||||
| -rwxr-xr-x | etc/rc.d/ypserv | 2 | ||||
| -rw-r--r-- | etc/rc.d/ypset | 2 | ||||
| -rw-r--r-- | etc/rc.d/ypupdated | 2 | ||||
| -rw-r--r-- | etc/rc.d/ypxfrd | 2 | 
20 files changed, 74 insertions, 41 deletions
| diff --git a/etc/rc.d/abi b/etc/rc.d/abi index 0c6b708bc7350..d2d3c31f604a0 100644 --- a/etc/rc.d/abi +++ b/etc/rc.d/abi @@ -23,6 +23,8 @@ sysv_start()  linux_start()  { +	local _tmpdir +  	echo -n ' linux'  	load_kld -e 'linux(aout|elf)' linux  	if [ -x /compat/linux/sbin/ldconfigDisabled ]; then diff --git a/etc/rc.d/accounting b/etc/rc.d/accounting index 777555db474b2..f2208e0093eab 100755 --- a/etc/rc.d/accounting +++ b/etc/rc.d/accounting @@ -20,6 +20,8 @@ stop_cmd="accounting_stop"  accounting_start()  { +	local _dir +  	_dir=`dirname "$accounting_file"`  	if [ ! -d `dirname "$_dir"` ]; then  		if ! mkdir -p "$_dir"; then diff --git a/etc/rc.d/archdep b/etc/rc.d/archdep index a53cf8dc30235..220d94f4aaebd 100644 --- a/etc/rc.d/archdep +++ b/etc/rc.d/archdep @@ -34,6 +34,8 @@ ibcs2_compat()  archdep_start()  { +	local _arch +  	_arch=`${SYSCTL_N} hw.machine_arch`  	echo -n "Initial $_arch initialization:"  	case $_arch in diff --git a/etc/rc.d/bluetooth b/etc/rc.d/bluetooth index 54806f38b979b..c48af640ee71c 100644 --- a/etc/rc.d/bluetooth +++ b/etc/rc.d/bluetooth @@ -43,6 +43,8 @@ stop_cmd="bluetooth_stop"  bluetooth_read_conf()  { +	local _err _file _line _namespace +  	_file=$1  	_namespace=$2  	_err=0 @@ -225,6 +227,8 @@ bluetooth_shutdown_stack()  bluetooth_start()  { +	local _file +  	dev=$1  	# Automatically load modules diff --git a/etc/rc.d/bootconf.sh b/etc/rc.d/bootconf.sh index 24803bcaeecfd..662dfaebfe2ee 100755 --- a/etc/rc.d/bootconf.sh +++ b/etc/rc.d/bootconf.sh @@ -45,8 +45,8 @@ bootconf_start()  	done  	echo  	master=$$ -	_DUMMY=/etc/passwd -	conf=${_DUMMY} +	DUMMY=/etc/passwd +	conf=${DUMMY}  	while [ ! -d /etc/etc.$conf/. ]; do  		trap "conf=$default; echo; echo Using default of $conf" ALRM  		echo -n "Which configuration [$default] ? " @@ -57,7 +57,7 @@ bootconf_start()  			conf=$default  		fi  		if [ ! -d /etc/etc.$conf/. ]; then -			conf=${_DUMMY} +			conf=${DUMMY}  		fi  	done diff --git a/etc/rc.d/bridge b/etc/rc.d/bridge index e2908db42ba7b..5c8f61a10a18f 100644 --- a/etc/rc.d/bridge +++ b/etc/rc.d/bridge @@ -35,7 +35,7 @@  name="bridge"  start_cmd="bridge_start"  stop_cmd="bridge_stop" -_cmd="" +cmd=""  glob_int () {  	case "$1" in @@ -52,7 +52,7 @@ bridge_test () {  	if [ -n "${interfaces}" ]; then  		for i in ${interfaces}; do  			if glob_int $iface $i ; then -				ifconfig $bridge $_cmd $iface > /dev/null 2>&1 +				ifconfig $bridge $cmd $iface > /dev/null 2>&1  				return  			fi  		done @@ -62,13 +62,13 @@ bridge_test () {  autobridge()  {  	if [ -n "${autobridge_interfaces}" ]; then -		if [ -z "$_iflist" ]; then +		if [ -z "$iflist" ]; then  			# We're operating as a general network start routine. -			_iflist="`list_net_interfaces`" +			iflist="`list_net_interfaces`"  		fi  		for br in ${autobridge_interfaces}; do -			for i in $_iflist; do +			for i in $iflist; do  				bridge_test $br $i  			done  		done @@ -77,17 +77,17 @@ autobridge()  bridge_start()  { -	_cmd="addm" +	cmd="addm"  	autobridge  }  bridge_stop()  { -	_cmd="deletem" +	cmd="deletem"  	autobridge  } -_iflist=$2 +iflist=$2  load_rc_config $name  run_rc_command "$1" diff --git a/etc/rc.d/ldconfig b/etc/rc.d/ldconfig index b59a2d9e8e3dd..481a2a5364b99 100755 --- a/etc/rc.d/ldconfig +++ b/etc/rc.d/ldconfig @@ -17,7 +17,7 @@ stop_cmd=":"  ldconfig_start()  { -	local _files +	local _files _ins  	_ins=  	ldconfig=${ldconfig_command} diff --git a/etc/rc.d/lpd b/etc/rc.d/lpd index dc2c3f35200d4..ff64262f3c778 100755 --- a/etc/rc.d/lpd +++ b/etc/rc.d/lpd @@ -14,9 +14,9 @@ name="lpd"  rcvar=`set_rcvar`  command="/usr/sbin/${name}"  required_files="/etc/printcap" -start_precmd="_chkprintcap" +start_precmd="chkprintcap" -_chkprintcap() +chkprintcap()  {  	if checkyesno chkprintcap_enable ; then  		/usr/sbin/chkprintcap ${chkprintcap_flags} diff --git a/etc/rc.d/moused b/etc/rc.d/moused index 6ef67bf592639..7f167cb5ecc4b 100644 --- a/etc/rc.d/moused +++ b/etc/rc.d/moused @@ -14,9 +14,9 @@ name=moused  rcvar=`set_rcvar`  command="/usr/sbin/${name}"  start_cmd="moused_start" -_pidprefix="/var/run/moused" -pidfile="${_pidprefix}.pid" -_pidarg= +pidprefix="/var/run/moused" +pidfile="${pidprefix}.pid" +pidarg=  load_rc_config $name  # Set the pid file and variable name. The second argument, if it exists, is @@ -25,8 +25,8 @@ load_rc_config $name  if [ -n "$2" ]; then  	eval moused_$2_enable=\${moused_$2_enable-${moused_nondefault_enable}}  	rcvar=`set_rcvar moused_$2` -	pidfile="${_pidprefix}.$2.pid" -	_pidarg="-I $pidfile" +	pidfile="${pidprefix}.$2.pid" +	pidarg="-I $pidfile"  fi  moused_start() @@ -53,20 +53,20 @@ moused_start()  	fi  	echo -n "Starting ${ms} moused:" -	/usr/sbin/moused ${myflags} -p ${myport} -t ${mytype} ${_pidarg} +	/usr/sbin/moused ${myflags} -p ${myport} -t ${mytype} ${pidarg} -	_mousechar_arg= +	mousechar_arg=  	case ${mousechar_start} in  	[Nn][Oo] | '')  		;;  	*)  		echo -n ' mousechar_start' -		_mousechar_arg="-M ${mousechar_start}" +		mousechar_arg="-M ${mousechar_start}"  		;;  	esac  	for ttyv in /dev/ttyv* ; do -		vidcontrol < ${ttyv} ${_mousechar_arg} -m on +		vidcontrol < ${ttyv} ${mousechar_arg} -m on  	done  	echo '.'  } diff --git a/etc/rc.d/netif b/etc/rc.d/netif index 36b459699a554..61ef8e3dbcc63 100644 --- a/etc/rc.d/netif +++ b/etc/rc.d/netif @@ -38,15 +38,15 @@ stop_cmd="network_stop"  cloneup_cmd="clone_up"  clonedown_cmd="clone_down"  extra_commands="cloneup clonedown" -_cmdifn= +cmdifn=  network_start()  {  	# Set the list of interfaces to work on.  	# -	_cmdifn=$* +	cmdifn=$* -	if [ -z "$_cmdifn" ]; then +	if [ -z "$cmdifn" ]; then  		#  		# We're operating as a general network start routine.  		# @@ -71,8 +71,8 @@ network_start()  		# Resync ipfilter  		/etc/rc.d/ipfilter resync  	fi -	if [ -f /etc/rc.d/bridge -a -n "$_cmdifn" ] ; then -		/etc/rc.d/bridge start $_cmdifn +	if [ -f /etc/rc.d/bridge -a -n "$cmdifn" ] ; then +		/etc/rc.d/bridge start $cmdifn  	fi  } @@ -80,7 +80,7 @@ network_stop()  {  	# Set the list of interfaces to work on.  	# -	_cmdifn=$* +	cmdifn=$*  	echo -n "Stopping network:" @@ -98,6 +98,8 @@ network_stop()  #	configured interface(s).  network_common()  { +	local _cooked_list _fail _func _verbose +  	_func=  	_verbose= @@ -111,15 +113,16 @@ network_common()  	# Set the scope of the command (all interfaces or just one).  	#  	_cooked_list= -	if [ -n "$_cmdifn" ]; then +	if [ -n "$cmdifn" ]; then  		# Don't check that the interfaces exist.  We need to run  		# the down code even when the interface doesn't exist to  		# kill off wpa_supplicant. -		_cooked_list="$_cmdifn" +		_cooked_list="$cmdifn"  	else  		_cooked_list="`list_net_interfaces`"  	fi +	_fail=  	for ifn in ${_cooked_list}; do  		if ${_func} ${ifn} ; then  			eval showstat_$ifn=1 diff --git a/etc/rc.d/nsswitch b/etc/rc.d/nsswitch index a99459a2c83c3..1540583c1633e 100644 --- a/etc/rc.d/nsswitch +++ b/etc/rc.d/nsswitch @@ -38,6 +38,8 @@ stop_cmd=":"  generate_host_conf()  { +    local _cont _sources +      nsswitch_conf=$1; shift;      host_conf=$1; shift; diff --git a/etc/rc.d/pppoed b/etc/rc.d/pppoed index b9cfb142a5cf8..c939112528c53 100644 --- a/etc/rc.d/pppoed +++ b/etc/rc.d/pppoed @@ -18,6 +18,8 @@ stop_cmd=":"  pppoed_start()  { +	local _opts +  	if [ -n "${pppoed_provider}" ]; then  			pppoed_flags="${pppoed_flags} -p ${pppoed_provider}"  	fi diff --git a/etc/rc.d/syslogd b/etc/rc.d/syslogd index 45e50f8edadcb..272d6b05f2a4b 100755 --- a/etc/rc.d/syslogd +++ b/etc/rc.d/syslogd @@ -18,12 +18,14 @@ required_files="/etc/syslog.conf"  start_precmd="syslogd_precmd"  extra_commands="reload" -_sockfile="/var/run/syslogd.sockets" +sockfile="/var/run/syslogd.sockets"  evalargs="rc_flags=\"\`set_socketlist\` \$rc_flags\""  altlog_proglist="named"  syslogd_precmd()  { +	local _l _ldir +  	#	Transitional symlink for old binaries  	#  	if [ ! -L /dev/log ]; then @@ -33,7 +35,7 @@ syslogd_precmd()  	#	Create default list of syslog sockets to watch  	# -	( umask 022 ; > $_sockfile ) +	( umask 022 ; > $sockfile )  	#	If running named(8) or ntpd(8) chrooted, added appropriate  	#	syslog socket to list of sockets to watch. @@ -41,7 +43,7 @@ syslogd_precmd()  	for _l in $altlog_proglist; do  		eval _ldir=\$${_l}_chrootdir  		if checkyesno `set_rcvar $_l` && [ -n "$_ldir" ]; then -			echo "${_ldir}/var/run/log" >> $_sockfile +			echo "${_ldir}/var/run/log" >> $sockfile  		fi  	done @@ -49,8 +51,8 @@ syslogd_precmd()  	#	internal copy of $syslogd_flags to force use of specific  	#	syslogd sockets.  	# -	if [ -s $_sockfile ]; then -		echo "/var/run/log" >> $_sockfile +	if [ -s $sockfile ]; then +		echo "/var/run/log" >> $sockfile  		eval $evalargs  	fi @@ -59,8 +61,10 @@ syslogd_precmd()  set_socketlist()  { +	local _s _socketargs +  	_socketargs= -	for _s in `cat $_sockfile | tr '\n' ' '` ; do +	for _s in `cat $sockfile | tr '\n' ' '` ; do  		_socketargs="-l $_s $_socketargs"  	done  	echo $_socketargs diff --git a/etc/rc.d/var b/etc/rc.d/var index be434fc428298..e11b3c787c3f5 100644 --- a/etc/rc.d/var +++ b/etc/rc.d/var @@ -36,7 +36,7 @@ name="var"  load_rc_config $name -_populate_var() +populate_var()  {  	/usr/sbin/mtree -deU -f /etc/mtree/BSD.var.dist -p /var > /dev/null  	case ${sendmail_enable} in @@ -73,7 +73,7 @@ esac  # in realistic diskless setups, we're probably ok.  case "${populate_var}" in  [Yy][Ee][Ss]) -	_populate_var +	populate_var  	;;  [Nn][Oo])  	exit 0 @@ -82,7 +82,7 @@ case "${populate_var}" in  	if [ -d /var/run -a -d /var/db -a -d /var/empty ] ; then  		true  	elif [ -x /usr/sbin/mtree ] ; then -		_populate_var +		populate_var  	else  		# We need mtree to populate /var so try mounting /usr.  		# If this does not work, we can not boot so it is OK to @@ -91,7 +91,7 @@ case "${populate_var}" in  		if [ ! -x /usr/sbin/mtree ] ; then  			exit 1  		else -			_populate_var +			populate_var  		fi  	fi  	;; diff --git a/etc/rc.d/ypbind b/etc/rc.d/ypbind index 0ed5cd5ec4266..6067d10da2231 100755 --- a/etc/rc.d/ypbind +++ b/etc/rc.d/ypbind @@ -20,6 +20,8 @@ command_args="${nis_client_flags}"  ypbind_precmd()  { +	local _domain +  	if ! checkyesno rpcbind_enable  && \  	    ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1  	then diff --git a/etc/rc.d/yppasswdd b/etc/rc.d/yppasswdd index 4e805f5f704d0..092a000e07b94 100755 --- a/etc/rc.d/yppasswdd +++ b/etc/rc.d/yppasswdd @@ -20,6 +20,8 @@ command_args="${nis_yppasswdd_flags}"  yppasswdd_precmd()  { +	local _domain +  	if ! checkyesno rpcbind_enable  && \  	    ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1  	then diff --git a/etc/rc.d/ypserv b/etc/rc.d/ypserv index 54ddd5bff611e..11651d60152d7 100755 --- a/etc/rc.d/ypserv +++ b/etc/rc.d/ypserv @@ -19,6 +19,8 @@ command_args="${nis_server_flags}"  ypserv_prestart()  { +	local _domain +  	if ! checkyesno rpcbind_enable  && \  	    ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1  	then diff --git a/etc/rc.d/ypset b/etc/rc.d/ypset index bf091c168d7fb..bc2c154365e16 100644 --- a/etc/rc.d/ypset +++ b/etc/rc.d/ypset @@ -17,6 +17,8 @@ command_args="${nis_ypset_flags}"  ypset_precmd()  { +	local _domain +  	if ! checkyesno rpcbind_enable  && \  	    ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1  	then diff --git a/etc/rc.d/ypupdated b/etc/rc.d/ypupdated index 106db0f4bf166..e1d6fd73a15fa 100644 --- a/etc/rc.d/ypupdated +++ b/etc/rc.d/ypupdated @@ -15,6 +15,8 @@ start_precmd="rpc_ypupdated_precmd"  rpc_ypupdated_precmd()  { +	local _domain +  	if ! checkyesno rpcbind_enable  && \  	    ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1  	then diff --git a/etc/rc.d/ypxfrd b/etc/rc.d/ypxfrd index 00cf607ab31d1..dd9488a96677d 100644 --- a/etc/rc.d/ypxfrd +++ b/etc/rc.d/ypxfrd @@ -17,6 +17,8 @@ command_args="${nis_ypxfrd_flags}"  ypxfrd_precmd()  { +	local _domain +  	if ! checkyesno rpcbind_enable  && \  	    ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1  	then | 
