[torquedev] PBS Server not closing inherited files

David Singleton David.Singleton at anu.edu.au
Wed Dec 5 14:03:08 MST 2007


I seem to remember we found that we needed to put this code fairly
early in the PBS server main when we used LDAP.  Otherwise you
close "persistent" fds opened during early name service calls.
Cant remember the details.

David

Steve Snelgrove wrote:
> 
> I found a small bug in the PBS Server code in pbsd_init where
> the sense of a compare was backwards.  The effect was that
> the close inherited files loop never ran.  This is probably not
> a big deal but should probably still be fixed.
> 
> In trying to correct this, I noticed that just changing the compare
> did not work because prior to calling pbsd_init, main had already
> opened the log file.  So this loop needs to be moved out to main.
> 
> The changes are shown below.  Should I go ahead and make this
> correction?
> 
> 
> 
> ssnelgrove at makua:~/torque/2.2-fixes/src/server$ svn diff
> Index: pbsd_init.c
> ===================================================================
> --- pbsd_init.c (revision 1652)
> +++ pbsd_init.c (working copy)
> @@ -283,11 +283,6 @@
> 
>   setgroups(1,(gid_t *)&i);    /* secure suppl. groups */
> 
> -  i = sysconf(_SC_OPEN_MAX);
> -
> -  while (--i < 2)
> -    close(i); /* close any file desc left open by parent */
> -
> #ifndef DEBUG
> #ifdef _CRAY
>   limit(C_JOB,      0,L_CPROC, 0);
> Index: pbsd_main.c
> ===================================================================
> --- pbsd_main.c (revision 1652)
> +++ pbsd_main.c (working copy)
> @@ -877,6 +877,11 @@
>     return(1);
>     }
> 
> +  i = sysconf(_SC_OPEN_MAX);
> +  while (--i > 2)
> +    close(i); /* close any file desc left open by parent */
> +
> +
>   /* make sure no other server is running with this home directory */
> 
>   sprintf(lockfile,"%s/%s/server.lock",
> s
> _______________________________________________
> torquedev mailing list
> torquedev at supercluster.org
> http://www.supercluster.org/mailman/listinfo/torquedev


More information about the torquedev mailing list