summaryrefslogtreecommitdiffstats
path: root/etc/rc.d/nscd
diff options
context:
space:
mode:
authorbushman <bushman@FreeBSD.org>2007-09-28 10:38:08 +0000
committerbushman <bushman@FreeBSD.org>2007-09-28 10:38:08 +0000
commita947d503156d99f0c775e19946e40c413ef41242 (patch)
treef0b4429f6c4f2e07780dbda5127778b30921f2e8 /etc/rc.d/nscd
parent1c797edf6bc8751b4d32db986f024da83d34a1f0 (diff)
downloadFreeBSD-src-a947d503156d99f0c775e19946e40c413ef41242.zip
FreeBSD-src-a947d503156d99f0c775e19946e40c413ef41242.tar.gz
Finishing renaming of cached into nscd. etc/rc.d and usr.sbin/Makefile
updated. Note added to UPDATING. Approved by: re (kensmith, bmah), brooks (mentor)
Diffstat (limited to 'etc/rc.d/nscd')
-rw-r--r--etc/rc.d/nscd28
1 files changed, 24 insertions, 4 deletions
diff --git a/etc/rc.d/nscd b/etc/rc.d/nscd
index 54d6bcc..3eb8823 100644
--- a/etc/rc.d/nscd
+++ b/etc/rc.d/nscd
@@ -8,7 +8,7 @@
# BEFORE: LOGIN
#
-# Add the following lines to /etc/rc.conf to enable cached:
+# Add the following lines to /etc/rc.conf to enable nscd:
#
# nscd_enable="YES"
#
@@ -24,9 +24,29 @@ command=/usr/sbin/nscd
extra_commands="flush"
flush_cmd="${command} -I all"
-nscd_enable=${nscd_enable:-"NO"}
-nscd_pidfile=${nscd_pidfile:-"/var/run/nscd.pid"}
-nscd_flags=${nscd_flags:-""}
+# usage: _nscd_set_option <option name> <default value>
+#
+_nscd_set_option() {
+ local _optname _defoptval _nscd_opt_val _cached_opt_val
+ _optname=$1
+ _defoptval=$2
+
+ _nscd_opt_val=$(eval "echo \$nscd_${_optname}")
+ _cached_opt_val=$(eval "echo \$cached_${_optname}")
+
+ if [ -n "$_cached_opt_val" -a "$_nscd_opt_val" != "$_defoptval" ]; then
+ warn "You should use nscd_${_optname} instead of" \
+ "cached_${_optname}"
+ setvar "nscd_${_optname}" "$_cached_opt_val"
+ else
+ setvar "nscd_${_optname}" "${_nscd_opt_val:-$_defoptval}"
+ fi
+}
+
load_rc_config $name
+_nscd_set_option "enable" "NO"
+_nscd_set_option "pidfile" "/var/run/nscd.pid"
+_nscd_set_option "flags" ""
run_rc_command "$1"
+
OpenPOWER on IntegriCloud