Ticket #1607: sge-sigchld.patch

File sge-sigchld.patch, 1.0 KB (added by opoplawski, 3 years ago)

Patch to not ignore SIGCHLD

  • source/daemons/qmaster/sge_qmaster_main.c

    diff --git a/source/daemons/qmaster/sge_qmaster_main.c b/source/daemons/qmaster/sge_qmaster_main.c
    index a79ae1b..88c80fe 100644
    a b int main(int argc, char* argv[]) 
    339339*  FUNCTION
    340340*     Initialize signal action and mask.
    341341*
    342 *     NOTE: We ignore SIGCHLD. This, together with the 'SA_NOCLDWAIT' flag,
    343 *     does make sure, that an unwaited for child process will not become
    344 *     a zombie process.
     342*     NOTE: We cannot ignore SIGCHLD as this breaks sge_peopen_r() error
     343*     reporting.  There have been reports of zombie child processes, but
     344*     this would need to be fixed properly by reaping them.
    345345*
    346346*  INPUTS
    347347*     none
    static void init_sig_action_and_mask(void) 
    356356   struct sigaction sa;
    357357   sigset_t sig_set;
    358358   
    359    sa.sa_handler = SIG_IGN;
    360    sigemptyset(&sa.sa_mask);
    361    sa.sa_flags = SA_NOCLDWAIT;
    362    sigaction(SIGCHLD, &sa, NULL);
    363    
    364359   sigfillset(&sig_set);
    365360   pthread_sigmask(SIG_SETMASK, &sig_set, NULL);
    366361