Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!husc6!mit-eddie!uw-beaver!tikal!hplsla!hpubvwa!weycord!jeff From: jeff@weycord Newsgroups: comp.sys.hp Subject: ipc "respawn" getty Message-ID: <400005@weycord> Date: Thu, 6-Aug-87 05:31:00 EDT Article-I.D.: weycord.400005 Posted: Thu Aug 6 05:31:00 1987 Date-Received: Sun, 9-Aug-87 07:30:38 EDT Lines: 42 A while ago I had a problem with the getty I keep around for uucp. I wanted it to "respawn" after uucp got a hit. The following little C routine works guite well. ( am I missing something? is there a better way? ) hpubvwa|weycord|jeff # This is a shell archive. Remove anything before this line, # then unpack it by saving it in a file and typing "sh file". # # Wrapped by jeff at weycord on Sat Aug 1 07:54:53 1987 # # This archive contains: # init.c # echo x - init.c cat >init.c <<'@EOF' #include int status; int wait(); int sleep(); int fork(); main() /* init is a continuous getty for uucp */ { signal( SIGINT, SIG_IGN ); while( 1 ) { if ( fork() == 0 ) execlp( "getty", "getty", "tty00", "1200", 0 ); wait( &status ); } } @EOF chmod 644 init.c exit 0