Deleted Added
full compact
rc.subr (161436) rc.subr (161530)
1# $NetBSD: rc.subr,v 1.66 2006/04/01 10:05:50 he Exp $
1# $NetBSD: rc.subr,v 1.66 2006/04/01 10:05:50 he Exp $
2# $FreeBSD: head/etc/rc.subr 161436 2006-08-18 13:07:38Z yar $
2# $FreeBSD: head/etc/rc.subr 161530 2006-08-22 11:17:29Z flz $
3#
4# Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
5# All rights reserved.
6#
7# This code is derived from software contributed to The NetBSD Foundation
8# by Luke Mewburn.
9#
10# Redistribution and use in source and binary forms, with or without

--- 490 unchanged lines hidden (view full) ---

501 _rc_prefix=one
502 rc_arg=${rc_arg#${_rc_prefix}}
503 if [ -n "${rcvar}" ]; then
504 eval ${rcvar}=YES
505 fi
506 ;;
507 esac
508
3#
4# Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
5# All rights reserved.
6#
7# This code is derived from software contributed to The NetBSD Foundation
8# by Luke Mewburn.
9#
10# Redistribution and use in source and binary forms, with or without

--- 490 unchanged lines hidden (view full) ---

501 _rc_prefix=one
502 rc_arg=${rc_arg#${_rc_prefix}}
503 if [ -n "${rcvar}" ]; then
504 eval ${rcvar}=YES
505 fi
506 ;;
507 esac
508
509 eval _override_command=\$${name}_program
510 command=${command:+${_override_command:-$command}}
511
509 _keywords="start stop restart rcvar $extra_commands"
510 rc_pid=
511 _pidcmd=
512 _procname=${procname:-${command}}
513
514 # setup pid check command
515 if [ -n "$_procname" ]; then
516 if [ -n "$pidfile" ]; then

--- 351 unchanged lines hidden (view full) ---

868}
869
870#
871# load_rc_config name
872# Source in the configuration file for a given name.
873#
874load_rc_config()
875{
512 _keywords="start stop restart rcvar $extra_commands"
513 rc_pid=
514 _pidcmd=
515 _procname=${procname:-${command}}
516
517 # setup pid check command
518 if [ -n "$_procname" ]; then
519 if [ -n "$pidfile" ]; then

--- 351 unchanged lines hidden (view full) ---

871}
872
873#
874# load_rc_config name
875# Source in the configuration file for a given name.
876#
877load_rc_config()
878{
876 local _tmp
877
878 _name=$1
879 if [ -z "$_name" ]; then
880 err 3 'USAGE: load_rc_config name'
881 fi
882
883 if ${_rc_conf_loaded:-false}; then
884 :
885 else
886 if [ -r /etc/defaults/rc.conf ]; then
887 debug "Sourcing /etc/defaults/rc.conf"
888 . /etc/defaults/rc.conf
889 source_rc_confs
890 elif [ -r /etc/rc.conf ]; then
891 debug "Sourcing /etc/rc.conf (/etc/defaults/rc.conf doesn't exist)."
892 . /etc/rc.conf
893 fi
894 _rc_conf_loaded=true
895 fi
879 _name=$1
880 if [ -z "$_name" ]; then
881 err 3 'USAGE: load_rc_config name'
882 fi
883
884 if ${_rc_conf_loaded:-false}; then
885 :
886 else
887 if [ -r /etc/defaults/rc.conf ]; then
888 debug "Sourcing /etc/defaults/rc.conf"
889 . /etc/defaults/rc.conf
890 source_rc_confs
891 elif [ -r /etc/rc.conf ]; then
892 debug "Sourcing /etc/rc.conf (/etc/defaults/rc.conf doesn't exist)."
893 . /etc/rc.conf
894 fi
895 _rc_conf_loaded=true
896 fi
896
897 eval _override_command=\$${name}_program
898 command=${command:+${_override_command:-$command}}
899
900 if [ -z "${command}" ]; then
901 _tmp=`/bin/realpath $0`
902 prefix=${_tmp%/etc/rc.d/*}/
903 else
904 prefix=${command%/*bin/*}/
905 fi
906 if [ "${prefix}" = "/" -o "${prefix}" = "/usr/" ] ; then
907 etcdir="/etc"
908 else
909 etcdir="${prefix}etc"
910 fi
911
912 # XXX - Deprecated
913 if [ -f /etc/rc.conf.d/${_name} -a ${etcdir} != "/etc" ]; then
897 if [ -f /etc/rc.conf.d/"$_name" ]; then
914 debug "Sourcing /etc/rc.conf.d/${_name}"
898 debug "Sourcing /etc/rc.conf.d/${_name}"
915 warn "Warning: /etc/rc.conf.d/${_name} is deprecated, please use ${etcdir}/rc.conf.d/${_name} instead."
916 if [ -f ${etcdir}/rc.conf.d/${_name} ]; then
917 warn "Warning: Both /etc/rc.conf.d/${_name} and ${etcdir}/rc.conf.d/${_name} exist."
918 fi
919 . /etc/rc.conf.d/${_name}
899 . /etc/rc.conf.d/"$_name"
920 fi
921
900 fi
901
922 if [ -f ${etcdir}/rc.conf.d/${_name} ]; then
923 debug "Sourcing ${etcdir}/rc.conf.d/${_name}"
924 . ${etcdir}/rc.conf.d/${_name}
925 fi
926
927 # XXX - Deprecated variable name support
928 #
929 case ${OSTYPE} in
930 FreeBSD)
931 [ -n "$portmap_enable" ] && rpcbind_enable="$portmap_enable"
932 [ -n "$portmap_program" ] && rpcbind_program="$portmap_program"
933 [ -n "$portmap_flags" ] && rpcbind_flags="$portmap_flags"
934 [ -n "$single_mountd_enable" ] && mountd_enable="$single_mountd_enable"

--- 582 unchanged lines hidden ---
902 # XXX - Deprecated variable name support
903 #
904 case ${OSTYPE} in
905 FreeBSD)
906 [ -n "$portmap_enable" ] && rpcbind_enable="$portmap_enable"
907 [ -n "$portmap_program" ] && rpcbind_program="$portmap_program"
908 [ -n "$portmap_flags" ] && rpcbind_flags="$portmap_flags"
909 [ -n "$single_mountd_enable" ] && mountd_enable="$single_mountd_enable"

--- 582 unchanged lines hidden ---