Commit 1fe81f07 authored by Doug Kehn's avatar Doug Kehn Committed by Thomas Petazzoni
Browse files

package/unscd: new package



A daemon which handles passwd, group and host lookups for running
programs and caches the results for the next query. This package is
intended to replace glibc nscd. Presently, glibc nscd is not installed
by Buildroot.

unscd depends on glibc because it relies on glibc function
__nss_disable_nscd.

nscd.conf is taken from glibc with unused configurations removed.

Cc: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: default avatarDoug Kehn <rdkehn@yahoo.com>
Reviewed-by: default avatarArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
parent 73690cb9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1579,6 +1579,7 @@ if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
	source "package/sysvinit/Config.in"
	source "package/tar/Config.in"
endif
	source "package/unscd/Config.in"
	source "package/util-linux/Config.in"
endmenu

+25 −0
Original line number Diff line number Diff line
config BR2_PACKAGE_UNSCD
	bool "unscd"
	depends on BR2_TOOLCHAIN_USES_GLIBC
	help
	  Micro Name Service Caching Daemon

	  A daemon which handles passwd, group and host lookups for
	  running programs and caches the results for the next query.
	  You only need this package if you are using slow Name Services
	  like LDAP, NIS or NIS+.

	  This particular NSCD is a complete rewrite of the GNU glibc
	  nscd which is a single threaded server process which offloads
	  all NSS lookups to worker children; cache hits are handled by
	  the parent, and only cache misses start worker children,
	  making the parent immune to resource leaks, hangs, and crashes
	  in NSS libraries.

	  It should mostly be a drop-in replacement for existing
	  installs using nscd.

	  http://busybox.net/~vda/unscd

comment "unscd needs an (e)glibc toolchain"
	depends on !BR2_TOOLCHAIN_USES_GLIBC

package/unscd/S46unscd

0 → 100644
+24 −0
Original line number Diff line number Diff line
#!/bin/sh

NAME="nscd"
DAEMON="/usr/sbin/${NAME}"

case "$1" in
start)
        printf "Starting ${NAME}: "
        start-stop-daemon -S -x ${DAEMON}
        [ $? -eq 0 ] && echo "OK" || echo "FAIL"
        ;;
stop)
        printf "Stopping ${NAME}: "
        start-stop-daemon -K -x ${DAEMON}
        [ $? -eq 0 ] && echo "OK" || echo "FAIL"
        ;;
restart|reload)
        $0 stop
        $0 start
        ;;
*)
        echo "Usage: $0 {start|stop|restart|reload}"
        exit 1
esac
+33 −0
Original line number Diff line number Diff line
# /etc/nscd.conf
#
# An example Name Service Cache config file.  This file is needed by nscd.
#
server-user unscd
debug-level 0

enable-cache            passwd  yes
positive-time-to-live   passwd  600
negative-time-to-live   passwd  20
suggested-size          passwd  1001
check-files             passwd  yes

enable-cache            group   yes
positive-time-to-live   group   3600
negative-time-to-live   group   60
suggested-size          group   1001
check-files             group   yes

# hosts caching is broken with gethostby* calls, hence is now disabled
# by default. Specifically, the caching does not obey DNS TTLs, and
# thus could lead to problems if the positive-time-to-live is
# significantly larger than the actual TTL.
#
# You should really use a caching nameserver instead of nscd for this
# sort of request. However, you can easily re-enable this by default.
enable-cache            hosts   no
positive-time-to-live   hosts   3600
negative-time-to-live   hosts   20
suggested-size          hosts   1001
check-files             hosts   yes

# unscd does not support services caching
+2 −0
Original line number Diff line number Diff line
# Locally computed:
sha256	4c1f83dcd120469fceef749050cb29fa666fa4666bd308dfe92e933a4c200d55	nscd-0.52.c
Loading