diff options
author | jkh <jkh@FreeBSD.org> | 1994-11-08 18:44:14 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1994-11-08 18:44:14 +0000 |
commit | ad3495c912bfaeb9d72b23a24dcd07919cee2672 (patch) | |
tree | e760dfdfd0dce19abc8d34facfeaa0769745ea90 /sbin | |
parent | da7f7b9ca022564d2c8dfcacab2591da084dcc75 (diff) | |
download | FreeBSD-src-ad3495c912bfaeb9d72b23a24dcd07919cee2672.zip FreeBSD-src-ad3495c912bfaeb9d72b23a24dcd07919cee2672.tar.gz |
Poul's and my idea of avoiding the last reboot at the end was
too ambitious; we can't make the transiton from install to /sbin/init
without another reboot. Sigh.. Oh well, not that big a deal.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/sysinstall/exec.c | 7 | ||||
-rw-r--r-- | sbin/sysinstall/main.c | 8 |
2 files changed, 7 insertions, 8 deletions
diff --git a/sbin/sysinstall/exec.c b/sbin/sysinstall/exec.c index 40b5eb0..00f6cd7 100644 --- a/sbin/sysinstall/exec.c +++ b/sbin/sysinstall/exec.c @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: exec.c,v 1.5 1994/10/29 10:01:32 phk Exp $ + * $Id: exec.c,v 1.6 1994/11/08 14:04:16 jkh Exp $ * */ @@ -24,6 +24,7 @@ #include <sys/wait.h> #include <sys/param.h> #include <sys/mount.h> +#include <sys/reboot.h> #include "sysinstall.h" @@ -73,8 +74,8 @@ exec(int magic, char *cmd, char *args, ...) while ((w = wait(&status)) != pid && w != -1) ; - if (w == 20 && magic == 3) /* special case for bininst */ - execl("/sbin/init", "/sbin/init", 0); + if ((status >> 8) == 20 && magic == 3) /* special case for bininst */ + reboot(RB_AUTOBOOT); if (w == -1) Fatal("Child process %s terminated abnormally\n", cmd); return(status); diff --git a/sbin/sysinstall/main.c b/sbin/sysinstall/main.c index c7ec57e..4b4b392 100644 --- a/sbin/sysinstall/main.c +++ b/sbin/sysinstall/main.c @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: main.c,v 1.11 1994/11/06 04:05:45 phk Exp $ + * $Id: main.c,v 1.12 1994/11/06 04:34:46 phk Exp $ * */ @@ -40,16 +40,14 @@ extern int alloc_memory(); int main(int argc, char **argv) { - int i; - /* Are we running as init? */ if (getpid() == 1) { + setsid(); close(0); open("/dev/console",O_RDWR); close(1); dup(0); close(2); dup(0); printf("sysinstall running as init\n\r"); - i = 1; - ioctl(0,TIOCSPGRP,&i); + ioctl(0,TIOCSCTTY,(char *)NULL); setlogin("root"); debug_fd = open("/dev/ttyv1",O_WRONLY); } else { |