diff options
author | jkh <jkh@FreeBSD.org> | 1996-12-29 05:51:40 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1996-12-29 05:51:40 +0000 |
commit | 5e34d5b143dabff5904dd8ddf328046ff144b0dc (patch) | |
tree | e7b58ba507e4925b6b451d933e56bd4542cc1220 /usr.sbin/sysinstall/system.c | |
parent | 9e30bacfe68adadb16f589596d5c635134ac9755 (diff) | |
download | FreeBSD-src-5e34d5b143dabff5904dd8ddf328046ff144b0dc.zip FreeBSD-src-5e34d5b143dabff5904dd8ddf328046ff144b0dc.tar.gz |
Support the use of the 2nd CDROM as a fixit aid. Also put the EHS
into a submenu in case you need to start it again (or at some other point
in the installation).
Submitted-By: joerg
Diffstat (limited to 'usr.sbin/sysinstall/system.c')
-rw-r--r-- | usr.sbin/sysinstall/system.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/usr.sbin/sysinstall/system.c b/usr.sbin/sysinstall/system.c index 3424070..1161ce6 100644 --- a/usr.sbin/sysinstall/system.c +++ b/usr.sbin/sysinstall/system.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: system.c,v 1.68 1996/12/11 19:35:26 jkh Exp $ + * $Id: system.c,v 1.69 1996/12/12 08:23:51 jkh Exp $ * * Jordan Hubbard * @@ -29,6 +29,8 @@ #define DOC_TMP_DIR "/tmp" #define DOC_TMP_FILE "/tmp/doc.tmp" +static pid_t ehs_pid; + /* * Handle interrupt signals - this probably won't work in all cases * due to our having bogotified the internal state of dialog or curses, @@ -294,7 +296,28 @@ void systemCreateHoloshell(void) { if (OnVTY && RunningAsInit) { - if (!fork()) { + + if (ehs_pid != 0) { + int pstat; + + if (kill(ehs_pid, 0) == 0) { + + if (msgYesNo("There seems to be an emergency holographic shell\n" + "already running von VTY 4.\n" + "Kill it and start a new one?")) + return; + + /* try cleaning up as much as possible */ + (void) kill(ehs_pid, SIGHUP); + sleep(1); + (void) kill(ehs_pid, SIGKILL); + } + + /* avoid too many zombies */ + (void) waitpid(ehs_pid, &pstat, WNOHANG); + } + + if ((ehs_pid = fork()) == 0) { int i, fd; struct termios foo; extern int login_tty(int); |