aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Shelton <stuart@shelton.me>2018-02-17 13:20:59 +0000
committerStuart Shelton <stuart@shelton.me>2018-02-17 13:20:59 +0000
commit034ee42c10f8c731fb0111d712ab646bf7675a08 (patch)
tree6626261e9f728cba8baafaec56e8b6a1347edaf5 /sys-libs/glibc/files/nscd.initd
parentUpdate sys-apps/busybox-1.28.0 (diff)
downloadsrcshelton-034ee42c10f8c731fb0111d712ab646bf7675a08.tar.gz
srcshelton-034ee42c10f8c731fb0111d712ab646bf7675a08.tar.bz2
srcshelton-034ee42c10f8c731fb0111d712ab646bf7675a08.zip
Update sys-libs/glibc-2.25-r10
Diffstat (limited to 'sys-libs/glibc/files/nscd.initd')
-rw-r--r--sys-libs/glibc/files/nscd.initd85
1 files changed, 85 insertions, 0 deletions
diff --git a/sys-libs/glibc/files/nscd.initd b/sys-libs/glibc/files/nscd.initd
new file mode 100644
index 00000000..6798e27a
--- /dev/null
+++ b/sys-libs/glibc/files/nscd.initd
@@ -0,0 +1,85 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+description="The 'Name Service Cache Daemon' is a daemon that provides a cache"
+description="${description} for the most common name service requests"
+
+extra_started_commands="flush_all flush_hosts flush_group flush_passwd flush_netgroup flush_services"
+
+description_flush_all="Will invalidate hosts, group, passwd, netgroup and services cache"
+description_flush_hosts="Will invalidate hosts cache"
+description_flush_group="Will invalidate group cache"
+description_flush_passwd="Will invalidate passwd cache"
+description_flush_netgroup="Will invalidate netgroup cache"
+description_flush_services="Will invalidate services cache"
+
+pidfile="/var/run/nscd/nscd.pid"
+command="/usr/sbin/nscd"
+
+depend() {
+ use dns ldap net slapd logger
+}
+
+checkconfig() {
+ if [ ! -d /var/run/nscd ] ; then
+ checkpath -d -m 755 /var/run/nscd
+ fi
+
+ if [ -z "${NSCD_PERMS_OK}" ] && [ "$(stat -c %a /var/run/nscd)" != "755" ] ; then
+ 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"
+ ewarn "To disable this warning, set 'NSCD_PERMS_OK' in /etc/conf.d/nscd"
+ fi
+
+ if grep -qs '^[[:space:]]*persistent\>' /etc/nscd.conf ; then
+ checkpath -d -m 700 /var/db/nscd
+ fi
+}
+
+_flush() {
+ local table=$1
+
+ ebegin "Flushing ${table} table"
+ ${command} --invalidate ${table}
+ eend $?
+}
+
+flush_all() {
+ local has_errors=0
+
+ ebegin "Flushing all caches"
+
+ local table=
+ for table in passwd group hosts netgroup services; do
+ ${command} --invalidate ${table}
+ [ $? -ne 0 ] && has_errors=1
+ done
+
+ eend ${has_errors}
+}
+
+flush_hosts() {
+ _flush hosts
+}
+
+flush_group() {
+ _flush group
+}
+
+flush_passwd() {
+ _flush passwd
+}
+
+flush_netgroup() {
+ _flush netgroup
+}
+
+flush_services() {
+ _flush services
+}
+
+start_pre() {
+ checkconfig
+}