aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-support
diff options
context:
space:
mode:
authorLiang Li <liang.li@windriver.com>2016-04-28 10:49:40 +0800
committerBruce Ashfield <bruce.ashfield@windriver.com>2016-04-28 09:20:51 -0400
commit05b5ca77a32df5bd68f6a09002e3e8161673bd9e (patch)
tree0b647528f108283c13359ec24e7bcd10414a9847 /recipes-support
parent2784c7efcc7349a2c7f82396a73ff45231264596 (diff)
downloadmeta-cloud-services-05b5ca77a32df5bd68f6a09002e3e8161673bd9e.tar.gz
meta-cloud-services-05b5ca77a32df5bd68f6a09002e3e8161673bd9e.tar.bz2
meta-cloud-services-05b5ca77a32df5bd68f6a09002e3e8161673bd9e.zip
nss-pam-ldapd: move from meta-openstack to base layer
To prepare enable nss-pam-ldapd reuseable by other layer/addons. Signed-off-by: Liang Li <liang.li@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'recipes-support')
-rw-r--r--recipes-support/nss-pam-ldapd/files/nslcd.init84
-rw-r--r--recipes-support/nss-pam-ldapd/nss-pam-ldapd_0.9.6.bb53
2 files changed, 137 insertions, 0 deletions
diff --git a/recipes-support/nss-pam-ldapd/files/nslcd.init b/recipes-support/nss-pam-ldapd/files/nslcd.init
new file mode 100644
index 0000000..a27b6e0
--- /dev/null
+++ b/recipes-support/nss-pam-ldapd/files/nslcd.init
@@ -0,0 +1,84 @@
+#!/bin/sh
+
+set -x
+
+NAME="nslcd"
+CONFIG="/etc/nslcd.conf"
+DAEMON="/usr/sbin/nslcd"
+DESC="LDAP connection daemon"
+STATEDIR="/var/run/$NAME"
+PIDFILE="$STATEDIR/$NAME.pid"
+
+start()
+{
+ if [ -e $PIDFILE ]; then
+ PIDDIR=/proc/$(cat $PIDFILE)
+ if [ -d ${PIDDIR} ]; then
+ echo "$DESC already running."
+ exit 1
+ else
+ echo "Removing stale PID file $PIDFILE"
+ rm -f $PIDFILE
+ fi
+ fi
+
+ echo -n "Starting $DESC..."
+
+ start-stop-daemon --start --oknodo \
+ --pidfile $PIDFILE --startas $DAEMON
+
+ if [ $? -eq 0 ]; then
+ echo "done."
+ else
+ echo "failed."
+ fi
+}
+
+stop()
+{
+ echo -n "Stopping $DESC..."
+ start-stop-daemon --stop --quiet --pidfile $PIDFILE \
+ --name $NAME
+ if [ $? -eq 0 ]; then
+ echo "done."
+ else
+ echo "failed."
+ fi
+ rm -f $PIDFILE
+}
+
+status()
+{
+ if [ -f $PIDFILE ]; then
+ if $DAEMON --check
+ then
+ echo "$DESC is running (pid `cat $PIDFILE`"
+ else
+ echo "$DESC stopped"
+ fi
+ else
+ echo "$DESC stopped"
+ fi
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart|force-reload|reload)
+ stop
+ start
+ ;;
+ status)
+ status
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|force-reload|restart|reload|status}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/recipes-support/nss-pam-ldapd/nss-pam-ldapd_0.9.6.bb b/recipes-support/nss-pam-ldapd/nss-pam-ldapd_0.9.6.bb
new file mode 100644
index 0000000..9f822f3
--- /dev/null
+++ b/recipes-support/nss-pam-ldapd/nss-pam-ldapd_0.9.6.bb
@@ -0,0 +1,53 @@
+SUMMARY = "NSS and PAM module for using LDAP as a naming service"
+DESCRIPTION = "\
+ daemon for NSS and PAM lookups using LDAP \
+ This package provides a daemon for retrieving user accounts and similar \
+ system information from LDAP. It is used by the libnss-ldapd and \
+ libpam-ldapd packages but is not very useful by itself. \
+ "
+
+HOMEPAGE = "http://arthurdejong.org/nss-pam-ldapd/"
+
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
+SECTION = "base"
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+SRC_URI = "\
+ http://arthurdejong.org/nss-pam-ldapd/${PN}-${PV}.tar.gz \
+ file://nslcd.init\
+ "
+
+inherit autotools
+
+SRC_URI[md5sum] = "fa5ec49cb54428d6c73e244a11021695"
+SRC_URI[sha256sum] = "101d5a7fa10549cc77be48d07f2b8141f59182f10f2cc0fea93efd13c3a5a6f2"
+
+DEPENDS += "libpam openldap"
+
+EXTRA_OECONF = "\
+ --disable-pynslcd \
+ --libdir=${base_libdir} \
+ --with-pam-seclib-dir=${base_libdir}/security \
+ "
+
+CONFFILES_${PN} += "${sysconfdir}/nslcd.conf"
+
+FILES_${PN} += "${base_libdir}/security ${datadir}"
+FILES_${PN}-dbg += "${base_libdir}/security/.debug"
+
+LDAP_DN ?= "dc=my-domain,dc=com"
+
+do_install_append() {
+ install -D -m 0755 ${WORKDIR}/nslcd.init ${D}${sysconfdir}/init.d/nslcd
+
+ sed -i -e 's/^uid nslcd/# uid nslcd/;' ${D}${sysconfdir}/nslcd.conf
+ sed -i -e 's/^gid nslcd/# gid nslcd/;' ${D}${sysconfdir}/nslcd.conf
+ sed -i -e 's/^base dc=example,dc=com/base ${LDAP_DN}/;' ${D}${sysconfdir}/nslcd.conf
+}
+
+inherit update-rc.d
+
+INITSCRIPT_NAME = "nslcd"
+INITSCRIPT_PARAMS = "defaults"