Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!think!ames!pacbell!att!mcdchg!ddsw1!tronsbox!tron1 From: tron1@tronsbox.UUCP (HIM) Newsgroups: comp.unix.i386 Subject: HELP! uucico hangs! Message-ID: <25a431cc:576.1comp.unix.i386;1@tronsbox.UUCP> Date: 5 Jan 90 05:48:31 GMT References: <9@strengur.is> Lines: 102 >same port). Everything works fine (I poll a computer every >2 hours) *until somebody logs in on that port!!* After that I get FAIL from >uucico every time it calls and the only cure seems to be to reboot the system. Ok.. I had the same problems and will post the solution here. I had FAILS from uucico until a friend of mine sent me that attached program. AS FAR as I can tell, after a log-in , the port gets LOCKED until something "pokes" it , this can be done by hand with a "> /dev/foo" as root, or you can put the following in your inittab or rc files... *************** /etc/rc2.d/S99poker ********************* (trap '' 1 2 3; /usr/local/bin/poker /dev/acu0 /dev/acu1 /dev/ttyd0 /dev/ttyd 1) 2>&1 >/dev/null & *************** MAKEFILE FOR POKER.C ******************** poker: poker.c cc -O poker.c -s -lc_s -o poker mcs -d poker ********************************************************* ************** .C CODE FOR POKER PROGRAM **************** #include /* sig_alarm(int sig): ** signal catcher for SIG_ALRM: just reset the signal to be caught again. */ int sig_alarm(sig) int sig; { (void) signal(sig, sig_alarm); } /* int main(int argc, char **argv): ** main line routine: for each argument argv[1]..argv[argc-1], assume it ** is the name of a (device) file, and attempt to open it for writing. ** This *seems* to wake up the 386/ix 2.0.2 asy device driver. The only ** safeguard is to set an alarm to break us out of the open(), in case the ** driver (or device) is in such a state that it cannot accept any open() ** requests. ** ** Should be invoked from either /etc/rc2.d/S99poker (perferred), or possibly ** directly from /etc/inittab (but fix /etc/conf/cf.d/init.base, or it ** will go away on every kernel installation). */ /* Modified on 11/05/89 to not use stderr */ int main(argc, argv) int argc; char **argv; { /* for ever */ for (;;) { int i; /* index for the argument list */ /* for each argument (except our name) */ for (i = 1; argv[i]; ++i) { int fd; /* file descriptor from open() */ /* setup our signal catcher */ (void) signal(SIGALRM, sig_alarm); /* allow the open 15 seconds to complete */ alarm(15); /* try to open the file for writing */ fd = open(argv[i], 1); /* cancel the alarm */ alarm(0); /* and reset the signal */ (void) signal(SIGALRM, SIG_DFL); /* did it work? */ if (fd == -1) { /* no: complain */ printf("POKER: Can't open %s\n", argv[i]); /* and go 'round the loop again */ continue; } /* yes: just close it; the driver might wake up now */ (void) close(fd); /* go away for a while so we don't use the whole CPU */ sleep(15); } } /* no way to get here, so no need for a return */ } ***************************************************** **************************************************************************** "Perfume and leather baby , you and me together baby, what good is living in paradise, if you don't let yourself once or twice." -Tiffany Kenneth J. Jamieson ---- THE BOSS at Xanadu Enterprises Inc. UUCP: tron1@tronsbox.UUCP BEST PATH ---> uunet!tronsbox!tron1 Sysop, Romantic Encounters BBS - (201)759-8450 / (201)759-8568 ****************************************************************************