Deleted Added
full compact
rc.subr (124832) rc.subr (126285)
1# $NetBSD: rc.subr,v 1.49 2002/05/21 12:31:01 lukem Exp $
1# $NetBSD: rc.subr,v 1.49 2002/05/21 12:31:01 lukem Exp $
2# $FreeBSD: head/etc/rc.subr 124832 2004-01-22 08:46:03Z mtm $
2# $FreeBSD: head/etc/rc.subr 126285 2004-02-26 12:19:48Z mtm $
3#
4# Copyright (c) 1997-2002 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

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

158# the rc.conf(5) variable $critical_filesystems_${type}, checking
159# each one to see if it is mounted, and if it is not, mounting it.
160#
161mount_critical_filesystems()
162{
163 eval _fslist=\$critical_filesystems_${1}
164 for _fs in $_fslist; do
165 mount | (
3#
4# Copyright (c) 1997-2002 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

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

158# the rc.conf(5) variable $critical_filesystems_${type}, checking
159# each one to see if it is mounted, and if it is not, mounting it.
160#
161mount_critical_filesystems()
162{
163 eval _fslist=\$critical_filesystems_${1}
164 for _fs in $_fslist; do
165 mount | (
166 _ismounted=no
166 _ismounted=false
167 while read what _on on _type type; do
168 if [ $on = $_fs ]; then
167 while read what _on on _type type; do
168 if [ $on = $_fs ]; then
169 _ismounted=yes
169 _ismounted=true
170 fi
171 done
170 fi
171 done
172 if [ $_ismounted = no ]; then
172 if $_ismounted; then
173 :
174 else
173 mount $_fs >/dev/null 2>&1
174 fi
175 )
176 done
177}
178
179#
180# check_pidfile pidfile procname [interpreter]

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

737 eval $_precmd
738 _return=$?
739 [ $_return -ne 0 ] && [ -z "$rc_force" ] &&
740 return 1
741 fi
742 # prevent restart being called more
743 # than once by any given script
744 #
175 mount $_fs >/dev/null 2>&1
176 fi
177 )
178 done
179}
180
181#
182# check_pidfile pidfile procname [interpreter]

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

739 eval $_precmd
740 _return=$?
741 [ $_return -ne 0 ] && [ -z "$rc_force" ] &&
742 return 1
743 fi
744 # prevent restart being called more
745 # than once by any given script
746 #
745 if [ -n "$_rc_restart_done" ]; then
747 if ${_rc_restart_done:-false}; then
746 return 0
747 fi
748 return 0
749 fi
748 _rc_restart_done=YES
750 _rc_restart_done=true
749
750 ( $0 ${rc_force:+force}stop )
751 $0 ${rc_force:+force}start
752
753 if [ -n "$_postcmd" ]; then
754 eval $_postcmd
755 _return=$?
756 fi

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

835#
836load_rc_config()
837{
838 _command=$1
839 if [ -z "$_command" ]; then
840 err 3 'USAGE: load_rc_config command'
841 fi
842
751
752 ( $0 ${rc_force:+force}stop )
753 $0 ${rc_force:+force}start
754
755 if [ -n "$_postcmd" ]; then
756 eval $_postcmd
757 _return=$?
758 fi

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

837#
838load_rc_config()
839{
840 _command=$1
841 if [ -z "$_command" ]; then
842 err 3 'USAGE: load_rc_config command'
843 fi
844
843 if [ -z "$_rc_conf_loaded" ]; then
845 if ${_rc_conf_loaded:-false}; then
846 :
847 else
844 if [ -r /etc/defaults/rc.conf ]; then
845 debug "Sourcing /etc/defaults/rc.conf"
846 . /etc/defaults/rc.conf
847 source_rc_confs
848 elif [ -r /etc/rc.conf ]; then
849 debug "Sourcing /etc/rc.conf (/etc/defaults/rc.conf doesn't exist)."
850 . /etc/rc.conf
851 fi
848 if [ -r /etc/defaults/rc.conf ]; then
849 debug "Sourcing /etc/defaults/rc.conf"
850 . /etc/defaults/rc.conf
851 source_rc_confs
852 elif [ -r /etc/rc.conf ]; then
853 debug "Sourcing /etc/rc.conf (/etc/defaults/rc.conf doesn't exist)."
854 . /etc/rc.conf
855 fi
852 _rc_conf_loaded=YES
856 _rc_conf_loaded=true
853 fi
854 if [ -f /etc/rc.conf.d/"$_command" ]; then
855 debug "Sourcing /etc/rc.conf.d/${_command}"
856 . /etc/rc.conf.d/"$_command"
857 fi
858
859 # XXX - Deprecated variable name support
860 #

--- 401 unchanged lines hidden ---
857 fi
858 if [ -f /etc/rc.conf.d/"$_command" ]; then
859 debug "Sourcing /etc/rc.conf.d/${_command}"
860 . /etc/rc.conf.d/"$_command"
861 fi
862
863 # XXX - Deprecated variable name support
864 #

--- 401 unchanged lines hidden ---