[Date Prev][Date Next] [Chronological] [Thread] [Top]

slapd daemonization (ITS#385)



Full_Name: Jeff Romine
Version: REL_ENG_2_0_ALPHA3, devel
OS: Solaris 7
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (206.81.132.94)


The shell script below never returns even though
no debug level is set.

-------------------------
#!/bin/sh

output="`slapd 2>&1`"
echo "OUTPUT " "$output"
-------------------------

This is because lutil_detach
doesn't close stdout or stderr if they are redirected
to something that isn't a terminal.  There doesn't seem
to be much value in leaving them open so I suggest
removing the test for isatty in lutil_detach. Below is
a cvs diff:

Index: detach.c
===================================================================
RCS file: /repo/OpenLDAP/pkg/ldap/libraries/liblutil/detach.c,v
retrieving revision 1.4.8.2
diff -r1.4.8.2 detach.c
86c86
< 			if ( sd != i && isatty( i ) )
---
> 			if ( sd != i )