summaryrefslogtreecommitdiffstats
path: root/source/n/nss-pam-ldapd/rc.nss-pam-ldapd
diff options
context:
space:
mode:
Diffstat (limited to 'source/n/nss-pam-ldapd/rc.nss-pam-ldapd')
-rw-r--r--source/n/nss-pam-ldapd/rc.nss-pam-ldapd37
1 files changed, 37 insertions, 0 deletions
diff --git a/source/n/nss-pam-ldapd/rc.nss-pam-ldapd b/source/n/nss-pam-ldapd/rc.nss-pam-ldapd
new file mode 100644
index 000000000..7a4252a38
--- /dev/null
+++ b/source/n/nss-pam-ldapd/rc.nss-pam-ldapd
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# rc.nss-pam-ldapd: start/stop/restart nslcd
+#
+# nslcd is a daemon that will do LDAP queries for local processes that want
+# to do user, group, and other naming lookups (NSS), or do user authentication,
+# authorization, or password modification (PAM).
+
+nslcd_start() {
+ if [ -x /usr/sbin/nslcd -a -r /etc/nslcd.conf ]; then
+ # Ensure /run directory exists:
+ mkdir -p /run/nslcd
+ echo "Starting local LDAP name service daemon: /usr/sbin/nslcd"
+ /usr/sbin/nslcd
+ fi
+}
+
+nslcd_stop() {
+ echo "Stopping local LDAP name service daemon."
+ killall --ns $$ nslcd
+}
+
+case "$1" in
+'start')
+ nslcd_start
+ ;;
+'stop')
+ nslcd_stop
+ ;;
+'restart')
+ nslcd_stop
+ sleep 2
+ nslcd_start
+ ;;
+*)
+ echo "usage $0 start|stop|restart"
+esac