summaryrefslogtreecommitdiffstats
path: root/net/openldap21
diff options
context:
space:
mode:
authorknu <knu@FreeBSD.org>2000-09-25 05:43:46 +0000
committerknu <knu@FreeBSD.org>2000-09-25 05:43:46 +0000
commit1d71d2f7e02152db58f5244f19818a9e6345b339 (patch)
treebc2d7cb35ddcacadeeaaf2ccdbec04724531c9a0 /net/openldap21
parent3123b8648e831c11d581fbdc6b408387e6a3a81d (diff)
downloadFreeBSD-ports-1d71d2f7e02152db58f5244f19818a9e6345b339.zip
FreeBSD-ports-1d71d2f7e02152db58f5244f19818a9e6345b339.tar.gz
Add a startup script for slapd.
Approved by: Lachlan O'Dea <lodea@vet.com.au> (MAINTAINER)
Diffstat (limited to 'net/openldap21')
-rw-r--r--net/openldap21/Makefile4
-rw-r--r--net/openldap21/files/slapd.sh31
2 files changed, 35 insertions, 0 deletions
diff --git a/net/openldap21/Makefile b/net/openldap21/Makefile
index 1e83b67..e73d39f 100644
--- a/net/openldap21/Makefile
+++ b/net/openldap21/Makefile
@@ -42,6 +42,9 @@ CONFIGURE_ARGS+= --enable-wrappers
pre-build:
cd ${WRKSRC} ; make depend
+post-build:
+ ${SED} 's,@@PREFIX@@,${PREFIX},g' ${FILESDIR}/slapd.sh >${WRKDIR}/slapd.sh
+
post-install:
strip ${PREFIX}/bin/ldapadd ${PREFIX}/bin/ldapdelete \
${PREFIX}/bin/ldapmodrdn ${PREFIX}/bin/ldapsearch ${PREFIX}/bin/ud \
@@ -54,5 +57,6 @@ post-install:
${PREFIX}/sbin/ldif2id2children ${PREFIX}/sbin/ldif2id2entry \
${PREFIX}/sbin/ldif2index ${PREFIX}/sbin/ldif2ldbm \
${PREFIX}/bin/ldapmodify ${PREFIX}/bin/ldappasswd
+ ${INSTALL_SCRIPT} ${WRKDIR}/slapd.sh ${PREFIX}/etc/rc.d/slapd.sh.sample
.include <bsd.port.post.mk>
diff --git a/net/openldap21/files/slapd.sh b/net/openldap21/files/slapd.sh
new file mode 100644
index 0000000..1704074
--- /dev/null
+++ b/net/openldap21/files/slapd.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# $FreeBSD$
+
+slapd=@@PREFIX@@/libexec/slapd
+pidfile=/var/run/slapd.pid
+
+case "$1" in
+start)
+ if [ -x $slapd ]; then
+ echo -n ' slapd'
+ $slapd
+ fi
+ ;;
+stop)
+ if [ -f $pidfile ]; then
+ kill `cat $pidfile`
+ telnet localhost ldap </dev/null >/dev/null 2>&1
+ echo -n ' slapd'
+ rm $pidfile
+ else
+ echo ' slapd: not running'
+ fi
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+esac
+
+exit 0
OpenPOWER on IntegriCloud