Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!gatech!bloom-beacon!eru!hagbard!sunic!ericom!eua.ericsson.se!erix.ericsson.se!per From: per@erix.ericsson.se (Per Hedeland) Newsgroups: comp.mail.uucp Subject: Re: Limiting Simultaneous 'uuxqts' on Pre-HDB UUCP Message-ID: <1990Oct19.121250.22003@eua.ericsson.se> Date: 19 Oct 90 12:12:50 GMT References: <1820@fallst.UUCP> <2588@van-bc.wimsey.bc.ca> Sender: news@eua.ericsson.se Reply-To: per@erix.ericsson.se (Per Hedeland) Organization: Ellemtel Telecom Systems Labs, Stockholm, Sweden Lines: 65 In article <2588@van-bc.wimsey.bc.ca>, jtc@van-bc.wimsey.bc.ca (J.T. Conklin) writes: |> A problem I have observed is that pre-HDB SCO uuxqt erroneously |> considers the lock file stale if it is "too" old and starts anyway. |> This is likely to happen if you are processing a lot of compressed |> news. This problem is certainly not unique to SCO's uuxqt... |> The way I solved the problem was to recompile bnews with SPOOLNEWS |> defined in defs.h. This is probably the best solution, but in case you prefer not to do it for some reason or other, here is a script I hacked together for SunOS 3.x/4.0[.x] - it may well work for other systems, perhaps with some tweaking; a necessary requirement is that the uucp programs store the process ID of the locker in the lock file. Btw, it will also help with long-running uucicos, where a corresponding problem can occur. Run from crontab with an interval shorter than the "stale" time (e.g. half-hourly). Regards --Per Hedeland per@erix.ericsson.se or per%erix.ericsson.se@uunet.uu.net or ...uunet!erix.ericsson.se!per uulckchk-------------------------------------------------------------------- #!/bin/sh # Update the mod, access, and change times (using touch(1)) of all uucp # lock files that still are valid (i.e. the process that created the file # is still active). This is a workaround for primitive uucp's that just # check the age of the lock file rather than checking for the process # when determining validity. # # Where the lock files live LCKDIR=/usr/spool/uucp cd $LCKDIR set LCK.* if [ "$1" = "LCK.*" ] then # No lock files found exit 0 fi for file do if [ -r "$file" ] then pid=`od -l $file | awk '$1~/0$/{print $2}'` if [ "$pid" != "" ] then # SunOS 3.2 kill(1) doesn't give a meaningful exit code # - we rely on ps (undocumented, but present in SunOS # 3.2 & 4.0, BSD 4.3) instead... #if kill -0 $pid >/dev/null 2>&1 if ps $pid >/dev/null 2>&1 then # Mustn't recreate the file if it went away # while weren't looking; hence -c touch -c $file >/dev/null 2>&1 fi fi fi done exit 0