Path: utzoo!attcan!uunet!zaphod.mps.ohio-state.edu!julius.cs.uiuc.edu!ux1.cso.uiuc.edu!uxc.cso.uiuc.edu!paul From: paul@uxc.cso.uiuc.edu (Paul Pomes - UofIllinois CSO) Newsgroups: comp.mail.sendmail Subject: Re: Sendmail problem.. Keywords: Sendmail Message-ID: <1990Dec14.144843.28375@ux1.cso.uiuc.edu> Date: 14 Dec 90 14:48:43 GMT References: <724@nuts.nu.oz.au> Sender: news@ux1.cso.uiuc.edu (News) Organization: University of Illinois at Urbana Lines: 58 gary@nucs.cs.nu.oz (Gary Carroll) writes: >Hello, > >I hope you can help us with this problem: > >Sendmail is leaving processes such as the ones below after sending mail. >The syslog file says that the status of the mail is sent and we can confirm >that the mail has arrived. These processes stay indefinitely chewing up >CPU time like crazy. We'd like to get rid of this problem! Any suggestions >or hints where to look would be more than welcome. > >We are using v5.65 of sendmail on a Sun 3/60. > >USER PID %CPU %MEM SZ RSS TT STAT START TIME COMMAND >root 1465 24.3 0.1 176 16 p1 R 14:06 22:39 -AA01463 arp.anu.edu.au: >root 1420 23.9 0.1 176 16 p1 R 13:58 26:02 -AA01418 arp.anu.edu.au: >root 1362 22.3 0.1 176 16 p6 R 13:43 40:03 -AA01356 arp.anu.edu.au: Examine the spool directory for old tfAA* files. Chances are that you'll find three with the same uid in the filename as the spinning processes. Sendmail is spinning in the top of queueup() in a do loop that tries to exclusively open the control file: do { strcpy(tf, queuename(e, 't')); fd = open(tf, O_CREAT|O_WRONLY|O_EXCL, FileMode); if (fd < 0) { if ( errno != EEXIST) { syserr("queueup: cannot create temp file %s", tf); return NULL; } } else { if (flock(fd, LOCK_EX|LOCK_NB) < 0) { if (errno != EWOULDBLOCK && errno != EAGAIN) syserr("cannot flock(%s)", tf); close(fd); fd = -1; sleep(1); } } } while (fd < 0); If the file exists, sendmail assumes some other sendmail has it and will let go of it Real Soon. If it belongs to a dead process, sendmail spins forever. My fix was to remove any pending tf* files at boot time. In addition I added a else clause with a syserr and sleep after the test for EEXIST. Why the tf* files are accumulating should be investigated as well. /pbp -- Paul Pomes UUCP: {att,iuvax,uunet}!uiucuxc!paul Internet, BITNET: paul@uxc.cso.uiuc.edu US Mail: UofIllinois, CSO, 1304 W Springfield Ave, Urbana, IL 61801-2910