bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug #4825] gnustep_sndd is hanging the debian build daemons


From: Eric Heintzmann
Subject: Re: [bug #4825] gnustep_sndd is hanging the debian build daemons
Date: 23 Aug 2003 13:29:56 +0200

Is it better to run gnustep_sndd at boot time (in
/etc/init.d/gnustep_sndd) or when user log in (in ~/.bashrc or
~/.cshrc)  ?

On Sat, 2003-08-23 at 05:25, nobody@savannah.gnu.org wrote:
> 
> =================== BUG #4825: LATEST MODIFICATIONS ==================
> http://savannah.gnu.org/bugs/?func=detailbug&bug_id=4825&group_id=99
> 
> Changes by: Adam Fedor <fedor@gnu.org>
> Date: Fri 08/22/2003 at 21:25 (US/Mountain)
> 
>             What     | Removed                   | Added
> ---------------------------------------------------------------------------
>           Resolution | None                      | Fixed
>          Assigned to | None                      | fedor
>               Status | Open                      | Closed
> 
> 
> ------------------ Additional Follow-up Comments ----------------------------
> Added something like the proposed patch
> 
> 
> 
> =================== BUG #4825: FULL BUG SNAPSHOT ===================
> 
> 
> Submitted by: ehz                     Project: GNUstep                      
> Submitted on: Mon 08/18/2003 at 09:09
> Category:  Gui/AppKit                 Severity:  5 - Major                  
> Bug Group:  Bug                       Resolution:  Fixed                    
> Assigned to:  fedor                   Status:  Closed                       
> 
> Summary:  gnustep_sndd is hanging the debian build daemons
> 
> Original Submission:  When trying to autobuild packages wich depend on 
> gnustep-gui0_0.8.8 for debian, gnustep_sndd hangs the debian build daemons.
> 
> Report from Ryan Murray :
> 
> >gnustep-gui0's sound server is hanging the build daemons 
> >again, however :(
> > 
> > When building gnustep-gui package or when building 
> >packages wich depend on gnustep-gui0 ?
> > 
> > Which depend on gnustep-gui0.  This can be caused by the
> > sound daemon not
> > properly backgrounding itself...
> > 
> > What's the status on this?  Recent gnustep needing uploads
> > hung the buildds again.  I'll be excluding these packages 
> > from the buildds if it isn't fixed the next time it 
> > happens...
> 
> Report from James Troup :
> 
> > gnustep_sndd doesn't properly daemonize (fails to close
> > fds, I guess?)... Someone should beat "how to program a 
> > daemon" into gnustep upstream; this isn't the first (or
> > second, or third :p) time we've had this problem with 
> > gnustep daemons.
> >
> > -- 
> > James
> 
> Mattias Klose has written a patch wich fix the problem.
> See the attached file.
> 
> 
> Follow-up Comments
> *******************
> 
> -------------------------------------------------------
> Date: Fri 08/22/2003 at 21:25       By: fedor
> Added something like the proposed patch
> 
> -------------------------------------------------------
> Date: Mon 08/18/2003 at 09:35       By: ehz
> The patch again (to be viewed online) :
> 
> 
> --- gsnd/gsnd.m~      2002-07-30 23:19:05.000000000 +0200
> +++ gsnd/gsnd.m       2003-08-14 07:36:43.000000000 +0200
> @@ -24,6 +24,7 @@
>  #include "portaudio/pa_common/portaudio.h"
>  #include <math.h>
>  #include <unistd.h>
> +#include <fcntl.h>
>  
>  #ifdef __MINGW__
>  #include "process.h"
> @@ -969,6 +970,8 @@
>  
>  int main(int argc, char** argv, char **env)
>  {
> +  int is_daemon = 1, c;
> +
>    CREATE_AUTORELEASE_POOL(pool);
>  
>  #ifdef GS_PASS_ARGUMENTS
> @@ -1007,6 +1010,42 @@
>       }
>  #endif 
>  
> +  /*
> +   * Ensure we don't have any open file descriptors which may refer
> +   * to sockets bound to ports we may try to use.
> +   *
> +   * Use '/dev/null' for stdin and stdout.  Assume stderr is ok.
> +   */
> +  for (c = 0; c < FD_SETSIZE; c++)
> +    {
> +      if (is_daemon /*|| (c != 2)*/)
> +     {
> +       (void)close(c);
> +     }
> +    }
> +  if (open("/dev/null", O_RDONLY) != 0)
> +    {
> +      NSLog(@"gsnd - failed to open stdin from /dev/null (%s)",
> +         strerror(errno));
> +      exit(EXIT_FAILURE);
> +    }
> +  if (open("/dev/null", O_WRONLY) != 1)
> +    {
> +      NSLog(@"gsnd - failed to open stdout from /dev/null (%s)",
> +         strerror(errno));
> +      exit(EXIT_FAILURE);
> +    }
> +  if (is_daemon && open("/dev/null", O_WRONLY) != 2)
> +    {
> +      NSLog(@"gsnd - failed to open stderr from /dev/null (%s)",
> +         strerror(errno));
> +      exit(EXIT_FAILURE);
> +    }
> +  if (0)
> +    {
> +      NSLog(@"gsnd - Closed descriptors");
> +    }
> +
>    gsnd = [[SoundServer alloc] init];
>  
>    if (gsnd == nil) {
> @@ -1262,4 +1301,3 @@
>       NSLog([NSString stringWithCString: s]);
>       return -1;
>  }
> -
> 
> 
> 
> 
> CC list is empty
> 
> 
> File Attachments
> ****************
> 
> -------------------------------------------------------
> Date: Mon 08/18/2003 at 09:09  Name: patch  Size: 1KB   By: ehz
> patch
> http://savannah.gnu.org/bugs/download.php?group_id=99&amp;bug_id=4825&amp;bug_file_id=606
> 
> 
> For detailed info, follow this link:
> http://savannah.gnu.org/bugs/?func=detailbug&bug_id=4825&group_id=99
> 
> _______________________________________________
>   Message sent via/by Savannah
>   http://savannah.gnu.org/
> 






reply via email to

[Prev in Thread] Current Thread [Next in Thread]