| 1 |
#!/sbin/runscript
|
| 2 |
# Copyright 1999-2002 Gentoo Technologies, Inc.
|
| 3 |
# Distributed under the terms of the GNU General Public License, v2 or later
|
| 4 |
# $Header$
|
| 5 |
|
| 6 |
|
| 7 |
start() {
|
| 8 |
ebegin "Starting Name Service Cache Daemon"
|
| 9 |
secure=` cat /etc/nsswitch.conf | while read curline ; do
|
| 10 |
table=${curline%:*}
|
| 11 |
entries=${curline##$table:}
|
| 12 |
table=${table%%[^a-z]*}
|
| 13 |
case $table in
|
| 14 |
passwd*|group*|hosts)
|
| 15 |
for entry in $entries ; do
|
| 16 |
case $entry in
|
| 17 |
nisplus*)
|
| 18 |
/usr/sbin/nscd_nischeck $table || \
|
| 19 |
/echo "-S $table,yes"
|
| 20 |
;;
|
| 21 |
esac
|
| 22 |
done
|
| 23 |
;;
|
| 24 |
esac
|
| 25 |
done`
|
| 26 |
start-stop-daemon --start --quiet --exec /usr/sbin/nscd -- $secure
|
| 27 |
eend $?
|
| 28 |
}
|
| 29 |
|
| 30 |
stop () {
|
| 31 |
ebegin "Shutting down Name Service Cache Daemon"
|
| 32 |
start-stop-daemon --stop --quiet --pid /var/run/nscd.pid
|
| 33 |
eend $?
|
| 34 |
}
|