Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Sep 2000 06:22:53 +0900
From:      "Akinori -Aki- MUSHA" <knu@idaemons.org>
To:        lodea@vet.com.au
Cc:        freebsd-ports@FreeBSD.org
Subject:   net/openldap: adding a startup script
Message-ID:  <86k8c1xz6a.wl@archon.local.idaemons.org>

next in thread | raw e-mail | index | archive | help
Hi,

Would you mind if I apply the following patch to your net/openldap
port?  With this change, slapd.sh.sample is installed in
${PREFIX}/etc/rc.d/ and users can enable it by renaming to slapd.sh.

Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/net/openldap/Makefile,v
retrieving revision 1.17
diff -u -r1.17 Makefile
--- Makefile	2000/08/21 10:07:32	1.17
+++ Makefile	2000/09/24 20:46:37
@@ -42,6 +42,9 @@
 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 @@
 	${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>
Index: files/slapd.sh
===================================================================
RCS file: slapd.sh
diff -N slapd.sh
--- /dev/null	Mon Sep 25 06:11:14 2000
+++ slapd.sh	Mon Sep 25 06:10:15 2000
@@ -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



By the way, do you have a plan to make an OpenLDAP 2.x port?  

-- 
                           /
                          /__  __       
                         / )  )  ) )  /
Akinori -Aki- MUSHA aka / (_ /  ( (__(  @ idaemons.org / FreeBSD.org

"We're only at home when we're on the run, on the wing, on the fly"


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86k8c1xz6a.wl>