summaryrefslogtreecommitdiff
path: root/sys-libs/musl-nscd/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-libs/musl-nscd/files
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-libs/musl-nscd/files')
-rw-r--r--sys-libs/musl-nscd/files/nscd.initd59
-rw-r--r--sys-libs/musl-nscd/files/nscd.service15
-rw-r--r--sys-libs/musl-nscd/files/nscd.tmpfilesd4
3 files changed, 78 insertions, 0 deletions
diff --git a/sys-libs/musl-nscd/files/nscd.initd b/sys-libs/musl-nscd/files/nscd.initd
new file mode 100644
index 000000000000..1bf83e7808af
--- /dev/null
+++ b/sys-libs/musl-nscd/files/nscd.initd
@@ -0,0 +1,59 @@
+#!/sbin/openrc-run
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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' in /etc/conf.d/nscd"
+ echo ""
+ fi
+}
+
+start() {
+ checkconfig
+
+ ebegin "Starting Name Service Cache Daemon"
+ local secure=`while read curline ; do
+ table=${curline%:*}
+ entries=${curline##$table:}
+ table=${table%%[^a-z]*}
+ case $table in
+ passwd*|group*|hosts)
+ for entry in $entries ; do
+ case $entry in
+ nisplus*)
+ /usr/sbin/nscd_nischeck $table || \
+ /echo "-S $table,yes"
+ ;;
+ esac
+ done
+ ;;
+ esac
+ done < /etc/nsswitch.conf`
+ mkdir -p "$(dirname ${PIDFILE:-/var/run/nscd/nscd.pid})"
+ start-stop-daemon --start --quiet \
+ --exec /usr/sbin/nscd --pidfile "${PIDFILE:-/var/run/nscd/nscd.pid}" \
+ -- $secure
+ eend $?
+}
+
+stop() {
+ ebegin "Shutting down Name Service Cache Daemon"
+ start-stop-daemon --stop --quiet --exec /usr/sbin/nscd --pidfile "${PIDFILE:-/var/run/nscd/nscd.pid}"
+ eend $?
+}
+
+# vim:ts=4
diff --git a/sys-libs/musl-nscd/files/nscd.service b/sys-libs/musl-nscd/files/nscd.service
new file mode 100644
index 000000000000..25a3b1d9be0a
--- /dev/null
+++ b/sys-libs/musl-nscd/files/nscd.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Name Service Cache Daemon
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/nscd -F
+ExecStop=/usr/sbin/nscd --shutdown
+ExecReload=/usr/sbin/nscd -i passwd
+ExecReload=/usr/sbin/nscd -i group
+ExecReload=/usr/sbin/nscd -i hosts
+ExecReload=/usr/sbin/nscd -i services
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
diff --git a/sys-libs/musl-nscd/files/nscd.tmpfilesd b/sys-libs/musl-nscd/files/nscd.tmpfilesd
new file mode 100644
index 000000000000..52edbba673cf
--- /dev/null
+++ b/sys-libs/musl-nscd/files/nscd.tmpfilesd
@@ -0,0 +1,4 @@
+# Configuration to create /run/nscd directory
+# Used as part of systemd's tmpfiles
+
+d /run/nscd 0755 root root