java/162522: OpenJDK 6 is not setting close on exec
ssanders at softhammer.net
Sun Nov 13 16:10:10 UTC 2011
>Synopsis: OpenJDK 6 is not setting close on exec
>Arrival-Date: Sun Nov 13 16:10:09 UTC 2011
>Originator: Stephen Sanders
>Release: FreeBSD 8.1
FreeBSD focus8.networkphysics.com 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:36:49 UTC 2010 root at mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64
It appears that OpenJDK does not set close on exec for file handles where Diablo did.
If a process attempts to restart itself via fork/exec without closing all file handles first, it's child will fail with complaints of 'socket in use'. Of course, this depends on what the child is doing. Probably the best example is tomcat calling a shell script that restarts tomcat.
This issue is hinted at in the comments of
Have tomcat exec a shell script that restarts tomcat.
Make sure the application closes all file handles before exec'ing a child.
More information about the freebsd-java