home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / bsd / 3099 < prev    next >
Encoding:
Text File  |  1992-07-29  |  2.1 KB  |  68 lines

  1. Newsgroups: comp.unix.bsd
  2. Path: sparky!uunet!news.univie.ac.at!news.tu-graz.ac.at!fstgds01!chmr
  3. From: chmr@fstgds01.tu-graz.ac.at (Christoph Robitschko)
  4. Subject: Bugs in init.c
  5. Message-ID: <1992Jul29.122823.5474@news.tu-graz.ac.at>
  6. Keywords: /sbin/init shutdown
  7. Sender: news@news.tu-graz.ac.at (USENET News System)
  8. Nntp-Posting-Host: fstgds01
  9. Organization: Technical University of Graz, Austria
  10. Date: Wed, 29 Jul 92 12:28:23 GMT
  11. Lines: 55
  12.  
  13.  
  14. I have found some bugs in /sbin/init. They caused the following behaviour:
  15.     - init didn't execute /etc/rc again if you brought your system to
  16.       singleuser and then back up.
  17.     - it didn't correctly react on TSTP siglals (which are sent by halt
  18.       and reboot). So it killed the user processes, but tried to start
  19.       new getty processes immediately, killed the getty processes, but 
  20.       tried to start new getty processes, ...
  21.     - a lost semicolon at the end of a while loop.
  22.  
  23. The following patch fixes these problems. I have also sent a BUGNFIX.FORM
  24. to ljolitz (about a week ago).
  25.  
  26.                             Have fun,
  27.                             Christoph
  28.  
  29.  
  30. cd /usr/src/sbin/init
  31. diff -p init.c.ori init.c
  32.  
  33. *** init.c.ori    Mon Jul 20 16:03:40 1992
  34. --- init.c    Mon Jul 20 17:57:51 1992
  35. *************** top:
  36. *** 188,194 ****
  37.                   execl("/bin/sh", "sh", "/etc/rc", Reboot, (char *)0);
  38.                   _exit(127);
  39.               }
  40. !             while(wait(&status) != pid)
  41.   
  42.               /* if we are about to be rebooted, then wait for it */
  43.               if (WIFSIGNALED(status) && WTERMSIG(status) == SIGKILL)
  44. --- 188,195 ----
  45.                   execl("/bin/sh", "sh", "/etc/rc", Reboot, (char *)0);
  46.                   _exit(127);
  47.               }
  48. !             Reboot = 0;
  49. !             while(wait(&status) != pid);
  50.   
  51.               /* if we are about to be rebooted, then wait for it */
  52.               if (WIFSIGNALED(status) && WTERMSIG(status) == SIGKILL)
  53. *************** top:
  54. *** 215,220 ****
  55. --- 216,223 ----
  56.               _exit(127);
  57.           }
  58.           while(wait(&status) != pid);
  59. +         while (drain)
  60. +             pause();
  61.           goto top;
  62.       }
  63.   
  64. -- 
  65. ------------------------------------------------------------------------
  66. Christoph M. Robitschko  | "the only man who got his work done by Friday
  67. chmr@edvz.tu-graz.ac.at  |             was Robinson Crusoe."
  68.