On Mon, Jun 25, 2018 at 08:49:31AM +0200, Landry Breuil wrote:
> On Mon, Jun 25, 2018 at 02:25:40AM -0300, Gleydson Soares wrote:
> > unbreak ldapd regress,
> > everything seems to be working fine.
>
> the point of the overly complicated grep line was to handle the case
> where you have a running production ldapd, and you spawn another one for
> regress.. that's also why it starts on another tcp port.
currently it's broken, grep doesn't grab the pid since
there's no pid there in log file.
<snip>
kill: illegal process id: startup
</snip>
here's a diff that works for me, if you have a better approach
let me know.
? ldapd1.conf
? log
Index: Makefile
===================================================================
RCS file: /cvs/src/regress/usr.sbin/ldapd/Makefile,v
retrieving revision 1.8
diff -u -p -r1.8 Makefile
--- Makefile 25 Jun 2017 22:06:06 -0000 1.8
+++ Makefile 25 Jun 2018 13:57:39 -0000
@@ -33,9 +33,9 @@ bootstrap:
@[ -z "${SUDO}" ] || ${SUDO} true
@${SUDO} install -m 600 -o root ${.CURDIR}/ldapd.conf
${.OBJDIR}/ldapd1.conf
@${SUDO} ldapd -n -r ${.OBJDIR} -f ${.OBJDIR}/ldapd1.conf
- @${SUDO} ldapd -dvv -r ${.OBJDIR} -f ${.OBJDIR}/ldapd1.conf >
${.OBJDIR}/log 2>&1 &
+ @${SUDO} ldapd -dvv -r ${.OBJDIR} -f ${.OBJDIR}/ldapd1.conf >
${.OBJDIR}/log 2>&1 & \
+ echo $$! > ${.OBJDIR}/ldapd.pid
@sleep 1
- @grep -a startup ${.OBJDIR}/log |sed -e 's/.*\[// ; s/\].*//' >
${.OBJDIR}/ldapd.pid
.if ! (make(clean) || make(cleandir) || make(obj))
.END: