home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / bsd / 5131 < prev    next >
Encoding:
Text File  |  1992-09-04  |  1.1 KB  |  39 lines

  1. Newsgroups: comp.unix.bsd
  2. Path: sparky!uunet!mcsun!sun4nl!eur.nl!pk
  3. From: pk@cs.few.eur.nl (Paul Kranenburg)
  4. Subject: [386BSD] init leaves improper signal mask
  5. Message-ID: <1992Sep4.160146.6295@cs.few.eur.nl>
  6. Keywords: init, signals
  7. Sender: news@cs.few.eur.nl
  8. Reply-To: pk@cs.few.eur.nl
  9. Organization: Erasmus University Rotterdam
  10. Date: Fri, 4 Sep 1992 16:01:46 GMT
  11. Lines: 26
  12.  
  13. init doesn't set up the proper signal disposition for the process (sh) it
  14. creates to run /etc/rc. While all signal handlers are reset to SIG_DFL, the
  15. signal mask is left unchanged causing SIGHUP and SIGTERM to be masked in
  16. all daemons started from /etc/rc.
  17.  
  18. This can be fixed by adding a `sigsetmask(0)' to the macro SIGNALSFORCHILD
  19. in init.c. This makes "kill -HUP `cat /var/run/syslog.pid`" work again.
  20.  
  21. -pk
  22.  
  23. Diffs of my current init.c against the original distribution:
  24.  
  25. ------- init.c -------
  26. 83c83,84
  27. <     signal(SIGTTIN, SIG_DFL); signal(SIGTTOU, SIG_DFL);
  28. ---
  29. >     signal(SIGTTIN, SIG_DFL); signal(SIGTTOU, SIG_DFL); \
  30. >     sigsetmask(0);
  31. 217c218
  32. <         while(wait(&status) != pid)
  33. ---
  34. >         while(wait(&status) != pid);
  35. 399c400
  36. <     exit(1);
  37. ---
  38. >     _exit(1);
  39.