#!/sbin/runscript # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/sys-apps/unscd/files/unscd.initd,v 1.2 2009/06/14 01:18:17 vapier Exp $ depend() { use dns ldap net slapd } checkconfig() { if [ ! -d /var/run/nscd ] ; then mkdir -p /var/run/nscd chmod 755 /var/run/nscd fi if [ -z "${NSCD_PERMS_OK}" ] && [ "$(stat -c %a /var/run/nscd)" != "755" ] ; then echo "" ewarn "nscd run dir is not world readable, you should reset the perms:" ewarn "chmod 755 /var/run/nscd" ewarn "chmod a+rw /var/run/nscd/socket" echo "" ewarn "To disable this warning, set 'NSCD_PERMS_OK=1' in /etc/conf.d/unscd" echo "" fi } start() { checkconfig ebegin "Starting Name Service Cache Daemon (unscd)" start-stop-daemon --start --quiet \ --exec /usr/sbin/unscd --pidfile /var/run/nscd/nscd.pid eend $? } stop() { ebegin "Shutting down Name Service Cache Daemon (unscd)" start-stop-daemon --stop --quiet \ --exec /usr/sbin/unscd --pidfile /var/run/nscd/nscd.pid eend $? }