home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.bsd
- Path: sparky!uunet!news.univie.ac.at!news.tu-graz.ac.at!fstgds01!chmr
- From: chmr@fstgds01.tu-graz.ac.at (Christoph Robitschko)
- Subject: Bugs in init.c
- Message-ID: <1992Jul29.122823.5474@news.tu-graz.ac.at>
- Keywords: /sbin/init shutdown
- Sender: news@news.tu-graz.ac.at (USENET News System)
- Nntp-Posting-Host: fstgds01
- Organization: Technical University of Graz, Austria
- Date: Wed, 29 Jul 92 12:28:23 GMT
- Lines: 55
-
-
- I have found some bugs in /sbin/init. They caused the following behaviour:
- - init didn't execute /etc/rc again if you brought your system to
- singleuser and then back up.
- - it didn't correctly react on TSTP siglals (which are sent by halt
- and reboot). So it killed the user processes, but tried to start
- new getty processes immediately, killed the getty processes, but
- tried to start new getty processes, ...
- - a lost semicolon at the end of a while loop.
-
- The following patch fixes these problems. I have also sent a BUGNFIX.FORM
- to ljolitz (about a week ago).
-
- Have fun,
- Christoph
-
-
- cd /usr/src/sbin/init
- diff -p init.c.ori init.c
-
- *** init.c.ori Mon Jul 20 16:03:40 1992
- --- init.c Mon Jul 20 17:57:51 1992
- *************** top:
- *** 188,194 ****
- execl("/bin/sh", "sh", "/etc/rc", Reboot, (char *)0);
- _exit(127);
- }
- ! while(wait(&status) != pid)
-
- /* if we are about to be rebooted, then wait for it */
- if (WIFSIGNALED(status) && WTERMSIG(status) == SIGKILL)
- --- 188,195 ----
- execl("/bin/sh", "sh", "/etc/rc", Reboot, (char *)0);
- _exit(127);
- }
- ! Reboot = 0;
- ! while(wait(&status) != pid);
-
- /* if we are about to be rebooted, then wait for it */
- if (WIFSIGNALED(status) && WTERMSIG(status) == SIGKILL)
- *************** top:
- *** 215,220 ****
- --- 216,223 ----
- _exit(127);
- }
- while(wait(&status) != pid);
- + while (drain)
- + pause();
- goto top;
- }
-
- --
- ------------------------------------------------------------------------
- Christoph M. Robitschko | "the only man who got his work done by Friday
- chmr@edvz.tu-graz.ac.at | was Robinson Crusoe."
-