aboutsummaryrefslogtreecommitdiff
path: root/net/openldap24-server
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2017-10-30 05:53:38 +0000
committerXin LI <delphij@FreeBSD.org>2017-10-30 05:53:38 +0000
commitf17a3a0f23c563e56453f472337ded5b2f8b91aa (patch)
tree3cfdde768dd6e8f5323624803e6bc585e0d83a0d /net/openldap24-server
parentf7d8f30d23a441579827c8f342618fe36f7ff56c (diff)
downloadports-f17a3a0f23c563e56453f472337ded5b2f8b91aa.tar.gz
ports-f17a3a0f23c563e56453f472337ded5b2f8b91aa.zip
Workaround an issue with kqueue support.
OpenLDAP does slapd_daemon_init() which will initialize kqueue(), but then calls lutil_detach() which will fork(), and the fork() would invalidate the kqueue descriptor in the child process. Completely solving this would require some intrusive changes so workaround this for now by calling rfork() without RFFDG and reorder file descriptor closure order. While I'm there also refrain from stopping slapd when deinstalling.
Notes
Notes: svn path=/head/; revision=453156
Diffstat (limited to 'net/openldap24-server')
-rw-r--r--net/openldap24-server/Makefile2
-rw-r--r--net/openldap24-server/files/extrapatch-ITS630028
-rw-r--r--net/openldap24-server/pkg-plist1
3 files changed, 29 insertions, 2 deletions
diff --git a/net/openldap24-server/Makefile b/net/openldap24-server/Makefile
index c6380b37196e..fbe735a7a1c7 100644
--- a/net/openldap24-server/Makefile
+++ b/net/openldap24-server/Makefile
@@ -65,7 +65,7 @@ BROKEN= incompatible OpenLDAP version: ${WANT_OPENLDAP_VER}
.endif
PORTREVISION_CLIENT= 0
-PORTREVISION_SERVER= 2
+PORTREVISION_SERVER= 3
OPENLDAP_SHLIB_MAJOR= 2
OPENLDAP_SHLIB_MINOR= 10.8
OPENLDAP_MAJOR= ${DISTVERSION:R}
diff --git a/net/openldap24-server/files/extrapatch-ITS6300 b/net/openldap24-server/files/extrapatch-ITS6300
index 35bffa449307..e59960d9aa3b 100644
--- a/net/openldap24-server/files/extrapatch-ITS6300
+++ b/net/openldap24-server/files/extrapatch-ITS6300
@@ -404,3 +404,31 @@
if ( LogTest( LDAP_DEBUG_ANY )) {
int t = ldap_pvt_thread_pool_backload( &connection_pool );
+--- libraries/liblutil/detach.c.orig 2017-06-01 20:01:07 UTC
++++ libraries/liblutil/detach.c
+@@ -73,7 +73,7 @@ lutil_detach( int debug, int do_close )
+ #ifdef HAVE_THR
+ pid = fork1();
+ #else
+- pid = fork();
++ pid = rfork(RFPROC);
+ #endif
+ switch ( pid )
+ {
+--- servers/slapd/main.c.orig 2017-06-01 20:01:07 UTC
++++ servers/slapd/main.c
+@@ -923,12 +923,11 @@ unhandled_option:;
+ if ( pid ) {
+ char buf[4];
+ rc = EXIT_SUCCESS;
+- close( waitfds[1] );
+ if ( read( waitfds[0], buf, 1 ) != 1 )
+ rc = EXIT_FAILURE;
+- _exit( rc );
+- } else {
++ close( waitfds[1] );
+ close( waitfds[0] );
++ _exit( rc );
+ }
+ }
+ #endif /* HAVE_WINSOCK */
diff --git a/net/openldap24-server/pkg-plist b/net/openldap24-server/pkg-plist
index 4c3ec2090802..9fbbc2ef7ec8 100644
--- a/net/openldap24-server/pkg-plist
+++ b/net/openldap24-server/pkg-plist
@@ -1,4 +1,3 @@
-@preunexec %%RC_DIR%%/etc/rc.d/slapd stop 2>&1 >/dev/null || true
%%ETCDIR%%/schema/README
%%ETCDIR%%/schema/collective.ldif
@sample %%ETCDIR%%/schema/collective.schema.sample