mirror of git://sourceware.org/git/glibc.git
Update.
* nscd/nscd.init: Test for kernel version and make LSB compliant. Patch by Christian Gafton.
This commit is contained in:
parent
23d914d96a
commit
aa6adf8229
|
|
@ -1,5 +1,8 @@
|
||||||
1999-08-16 Ulrich Drepper <drepper@cygnus.com>
|
1999-08-16 Ulrich Drepper <drepper@cygnus.com>
|
||||||
|
|
||||||
|
* nscd/nscd.init: Test for kernel version and make LSB compliant.
|
||||||
|
Patch by Christian Gafton.
|
||||||
|
|
||||||
* sysdeps/unix/sysv/linux/sparc/bits/fcntl.h: Define O_DSYNC and
|
* sysdeps/unix/sysv/linux/sparc/bits/fcntl.h: Define O_DSYNC and
|
||||||
O_RSYNC. Patch by Christian Gafton.
|
O_RSYNC. Patch by Christian Gafton.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
# for running programs and cache the results for the next \
|
# for running programs and cache the results for the next \
|
||||||
# query. You should start this daemon only if you use \
|
# query. You should start this daemon only if you use \
|
||||||
# slow Services like NIS or NIS+
|
# slow Services like NIS or NIS+
|
||||||
# processname: nscd
|
# processname: nscd
|
||||||
# config: /etc/nscd.conf
|
# config: /etc/nscd.conf
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
@ -18,38 +18,67 @@
|
||||||
# Source function library.
|
# Source function library.
|
||||||
. /etc/rc.d/init.d/functions
|
. /etc/rc.d/init.d/functions
|
||||||
|
|
||||||
|
# nscd does not run on any kernel lower than 2.2.0 because of threading
|
||||||
|
# problems, so we require that in first place.
|
||||||
|
case $(uname -r) in
|
||||||
|
2.[2-9].*)
|
||||||
|
# this is okay
|
||||||
|
;;
|
||||||
|
[3-9]*)
|
||||||
|
# these are of course also okay
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
#this is not
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
RETVAL=0
|
||||||
|
|
||||||
# See how we were called.
|
# See how we were called.
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
secure=""
|
secure=""
|
||||||
for table in passwd group hosts
|
# for table in passwd group
|
||||||
do
|
# do
|
||||||
if egrep '^'$table':.*nisplus' /etc/nsswitch.conf >/dev/null
|
# if egrep '^'$table':.*nisplus' /etc/nsswitch.conf >/dev/null
|
||||||
then
|
# then
|
||||||
/usr/sbin/nscd_nischeck $table ||
|
# /usr/lib/nscd_nischeck $table ||
|
||||||
secure="$secure -S $table,yes"
|
# secure="$secure -S $table,yes"
|
||||||
fi
|
# fi
|
||||||
done
|
# done
|
||||||
echo -n "Starting Name Switch Cache Daemon: "
|
echo -n "Starting Name Switch Cache Daemon: "
|
||||||
daemon nscd $secure
|
daemon nscd $secure
|
||||||
|
RETVAL=$?
|
||||||
echo
|
echo
|
||||||
touch /var/lock/subsys/nscd
|
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/nscd
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
echo -n "Stopping Name Switch Cache Daemon: "
|
echo -n "Stopping Name Switch Cache Daemon: "
|
||||||
/usr/sbin/nscd -K
|
/usr/sbin/nscd -K
|
||||||
rm -f /var/lock/subsys/nscd
|
RETVAL=$?
|
||||||
echo nscd
|
if [ $RETVAL -eq 0 ]; then
|
||||||
|
rm -f /var/lock/subsys/nscd
|
||||||
|
echo nscd
|
||||||
|
else
|
||||||
|
echo
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
status)
|
status)
|
||||||
status nscd
|
status nscd
|
||||||
|
RETVAL=$?
|
||||||
;;
|
;;
|
||||||
restart)
|
restart)
|
||||||
$0 stop
|
$0 stop
|
||||||
$0 start
|
$0 start
|
||||||
|
RETVAL=$?
|
||||||
|
;;
|
||||||
|
reload)
|
||||||
|
killproc -HUP nscd
|
||||||
|
RETVAL=$?
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: $0 {start|stop|status|restart}"
|
echo "Usage: $0 {start|stop|status|restart}"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
exit 0
|
exit $RETVAL
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue