CHANGE RUN LEVEL (SINGLE USER/MULTIUSER/HALT)
authorChristoph Robitschko <chmr@edvz.tu-graz.ac.at>
Fri, 31 Jul 1992 00:00:00 +0000 (00:00 +0000)
committerChristoph Robitschko <chmr@edvz.tu-graz.ac.at>
Fri, 31 Jul 1992 00:00:00 +0000 (00:00 +0000)
/sbin/init did not set some internal flags correctly (Reboot, drain)
This caused it to not execute /etc/rc again if the system was brought down
to singleuser and the back up again.  It also tried to start multiuser mode
when you tried halt or reboot in singleuser (when the singleuser shell was
terminated by halt/reboot).

AUTHOR: Christoph Robitschko (chmr@edvz.tu-graz.ac.at)
386BSD-Patchkit: patch00022

usr/src/sbin/init/init.c

index e7bf076..8fa3e77 100644 (file)
  *
  * PATCHES MAGIC                LEVEL   PATCH THAT GOT US HERE
  * --------------------         -----   ----------------------
  *
  * PATCHES MAGIC                LEVEL   PATCH THAT GOT US HERE
  * --------------------         -----   ----------------------
- * CURRENT PATCH LEVEL:         1       00014
+ * CURRENT PATCH LEVEL:         2       00022
  * --------------------         -----   ----------------------
  *
  * --------------------         -----   ----------------------
  *
+ * 31 Jul 92   Christoph Robitschko    Fixed run level change code
  * 04 Sep 92   Paul Kranenburg         Fixed kill -1 and kill -15 for
  *                                     daemons started from /etc/rc.
  */
  * 04 Sep 92   Paul Kranenburg         Fixed kill -1 and kill -15 for
  *                                     daemons started from /etc/rc.
  */
@@ -197,6 +198,7 @@ top:
                                execl("/bin/sh", "sh", "/etc/rc", Reboot, (char *)0);
                                _exit(127);
                        }
                                execl("/bin/sh", "sh", "/etc/rc", Reboot, (char *)0);
                                _exit(127);
                        }
+                       Reboot = 0;                     /* 31 Jul 92*/
                        while(wait(&status) != pid);
 
                        /* if we are about to be rebooted, then wait for it */
                        while(wait(&status) != pid);
 
                        /* if we are about to be rebooted, then wait for it */
@@ -224,6 +226,8 @@ top:
                        _exit(127);
                }
                while(wait(&status) != pid)
                        _exit(127);
                }
                while(wait(&status) != pid)
+               while(drain)                            /* 31 Jul 92*/
+                       pause();
                goto top;
        }
 
                goto top;
        }