[comp.unix.aux] Bug in Bnews sendbatch.sh with A/UX UUCP

alexis@panix.UUCP (Alexis Rosen) (09/21/90)

Here's a Bnews bug, and one way to fix it. It's in version 2.11 (2.11.18?)
The sendbatch is marked as version 1.22, 10/29/89.

The symptom: News postings never make it off your machine.

There seems to be a small bug in sendbatch. It tries to figure out how much
space is being used by a particular UUCP partner's files, in order to prevent
overflowing the disk. It runs du on /usr/spool/uucp/{your uucp partner}.

It's clever enough not to run du if the directory isn't there. Unfortunately,
it uses the result of the du in an expr command. This is an error, since the
result of the du was never created in the first place, and the script aborts.

The easy workaround is to make a directory in /usr/spool/news, named with your
uucp partner's name. Of course, this doesn't check to see how much space
batches for your partner are taking. If you want to do that, you'll need to
modify the sendbatch script, replacing the du command with one that totals up
the usage of each file going to that system. I don't think this is a really
good idea.

This works on A/UX 2.0. I can't imagine that it's true on all System V
machines with old UUCP. So, would someone who runs Bnews on such a system
please tell me what their sendbatch does?

Alexis Rosen
A/UX Victim (but lots happier since 2.0 came out)
{cmcl2,apple}!panix!alexis

mdv@comtst.UUCP (Mike Verstegen) (09/22/90)

In article <10491@panix.UUCP> alexis@panix.UUCP (Alexis Rosen) writes:
>Here's a Bnews bug, and one way to fix it. It's in version 2.11 (2.11.18?)
>The sendbatch is marked as version 1.22, 10/29/89.
>
>The symptom: News postings never make it off your machine.
>
>There seems to be a small bug in sendbatch. It tries to figure out how much
>space is being used by a particular UUCP partner's files, in order to prevent
>overflowing the disk. It runs du on /usr/spool/uucp/{your uucp partner}.
>
[ stuff deleted ]
>
>Alexis Rosen
>A/UX Victim (but lots happier since 2.0 came out)
>{cmcl2,apple}!panix!alexis

Quite coincidentally, we had the same problem here (System V on 3B2) and just
before reading this article, I had fixed it here with a slightly different
solution as shown by the following sendbatch fragment.

: '@(#)sendbatch.sh	1.22	10/29/89'
.....
	if test -n "$MAXBATCH" -a -d /usr/spool/uucp/$rmt
	then
		du=`du "/usr/spool/uucp/$rmt" | sed 's/	.*/000/'`
		if test ! -z "$du" -a \( "$du" -gt $MAXBATCH \)
		then 
			echo $rmt already has $du Kbytes queued
			continue
		fi
	else			# Added MDV 9/22/90: du was not set and caused
		du=0		# error in expr below.
	fi
.....

This seems to work here and does not require any manual intervention for
the creation of any directory. Hope this helps.


Mike
--
Mike Verstegen          Domain Systems, Inc           Voice +1 407 686-7911
..!uunet!comtst!mdv     5840 Corporate Way #100       Fax   +1 407 478-2542
mdv@domain.com          West Palm Beach, FL 33407

alexis@panix.UUCP (Alexis Rosen) (09/24/90)

In article <147@comtst.UUCP> mdv@comtst.UUCP (Mike Verstegen) writes:
>In article <10491@panix.UUCP> alexis@panix.UUCP (Alexis Rosen) writes:
>>Here's a Bnews bug, and one way to fix it. It's in version 2.11 (2.11.18?)
>>The sendbatch is marked as version 1.22, 10/29/89.
>>
>>The symptom: News postings never make it off your machine.
>[ stuff deleted ]
>
>Quite coincidentally, we had the same problem here (System V on 3B2) and just
>before reading this article, I had fixed it here with a slightly different
>solution as shown by the following sendbatch fragment.

Mike's solution is obviously better as a canned fix. I fixed it by adding the
directory so that I wouldn't forget to do something some permanent about it
at a later date.  All things considered, you probably want to use his two-line
addition. I just built Cnews today, and it does the exact same thing as the
fix- punt unless you write the code yourself. Not all that surprising... :-(

This is such an abvious problem, I wonder how it could survive so long. Are
there so few old-style UUCP machines left?

Alexis Rosen
A/UX Victim (still)
cmcl2!panix!alexis