jeff@weycord (08/06/87)
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 <signal.h>
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