ath(4): Really unbreak MODULES_WITH_WORLD building.
[dragonfly.git] / etc / rc.d / nscd
blob13bbd851c8916f35f2f5dda52902c5ff0cb75fcb
1 #!/bin/sh
3 # $FreeBSD: src/etc/rc.d/nscd,v 1.7 2008/07/16 19:50:29 dougb Exp $
6 # PROVIDE: nscd
7 # REQUIRE: DAEMON
8 # BEFORE: LOGIN
9 # KEYWORD: shutdown
12 # Add the following lines to /etc/rc.conf to enable nscd:
14 # nscd_enable="YES"
16 # See nscd(8) for flags
19 . /etc/rc.subr
21 name=nscd
22 rcvar=`set_rcvar`
24 command=/usr/sbin/nscd
25 extra_commands="flush"
26 flush_cmd="${command} -I all"
28 # usage: _nscd_set_option <option name> <default value>
30 _nscd_set_option() {
31 local _optname _defoptval _nscd_opt_val _cached_opt_val
32 _optname=$1
33 _defoptval=$2
35 _nscd_opt_val=$(eval "echo \$nscd_${_optname}")
36 _cached_opt_val=$(eval "echo \$cached_${_optname}")
38 if [ -n "$_cached_opt_val" -a "$_nscd_opt_val" != "$_defoptval" ]; then
39 warn "You should use nscd_${_optname} instead of" \
40 "cached_${_optname}"
41 setvar "nscd_${_optname}" "$_cached_opt_val"
42 else
43 setvar "nscd_${_optname}" "${_nscd_opt_val:-$_defoptval}"
48 load_rc_config $name
49 _nscd_set_option "enable" "NO"
50 _nscd_set_option "pidfile" "/var/run/nscd.pid"
51 _nscd_set_option "flags" ""
52 run_rc_command "$1"