mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-29 06:42:45 +00:00
Flesh out a simple framework for dependency checking rc.conf enabled
services. Simple YES/NO style *_enable services are supported. Reviewed by: obrien
This commit is contained in:
parent
05f9877c15
commit
3306abc459
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=69988
42
etc/rc
42
etc/rc
@ -71,36 +71,32 @@ elif [ -r /etc/rc.conf ]; then
|
||||
. /etc/rc.conf
|
||||
fi
|
||||
|
||||
# Deal with dependancies.
|
||||
case ${amd_enable} in
|
||||
chkdepend() {
|
||||
svc=$1
|
||||
svc_var=$2
|
||||
dep=$3
|
||||
dep_var=$4
|
||||
|
||||
eval svc_val=\${$svc_var}
|
||||
eval dep_val=\${$dep_var}
|
||||
|
||||
case ${svc_val} in
|
||||
[Yy][Ee][Ss])
|
||||
case ${portmap_enable} in
|
||||
case ${dep_val} in
|
||||
[Yy][Ee][Ss])
|
||||
;;
|
||||
;;
|
||||
*)
|
||||
portmap_enable="YES"
|
||||
echo "DEPENDENCY NOTE: portmap will be enabled" \
|
||||
"to support amd"
|
||||
;;
|
||||
eval ${dep_var}="YES"
|
||||
echo "DEPENDENCY NOTE: ${dep} will be enabled" \
|
||||
"to support ${svc}"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
case ${nfs_server_enable} in
|
||||
[Yy][Ee][Ss])
|
||||
if [ -r /etc/exports ]; then
|
||||
case ${portmap_enable} in
|
||||
[Yy][Ee][Ss])
|
||||
;;
|
||||
*)
|
||||
portmap_enable="YES"
|
||||
echo "DEPENDENCY NOTE: portmap will be enabled" \
|
||||
"to support NFS"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
chkdepend amd amd_enable portmap portmap_enable
|
||||
chkdepend NFS nfs_server_enable portmap portmap_enable
|
||||
|
||||
# First pass at entropy recovery so the rebooting /dev/random can reseed.
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user