🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.b
Article #7082

CNEWS Spacefor problems (CNEWS2)

#7082
From: Damian Centgraf - WSHB System Ad...
Date: Mon, 28 Feb 1994 11:51
132 lines
5531 bytes

Hi,
	
	I was wondering if anyone could give me some help with cnews.  I
and currently trying to get it up and running on a 486 machine running
SCO ODT 3.0 as a server and run a mounted spooler via NFS.

	I am having problems with too little space when I try to post
an article doing inews.

	When doing a df command I receive the following:

/         (/dev/root        ):   386524 blocks    48367 i-nodes
/u        (/dev/u           ):   410892 blocks    47743 i-nodes
/usr/spool/news (swii:/usr/spool/news ):   261438 blocks        0 i-nodes

	when I do a df /usr/spool/news I receive the following:

/usr/spool/news (swii:/usr/spool/news ):   261438 blocks        0 i-nodes

	The Inodes are there on the swii machine.  So the 0 inodes is 
misleading.

	I've tried to run the program with spacefor.sysv, spacefor.v7 
to no avail.  I've added some echo statements to the spacefor file
to see where the problem is.  I was unable to get the nf and nr outputs.
I don't understand what is trying to be done here.
	I've also sent along spacefor to show where the echo statements
are placed.
	I hope you will be able to help me with this.  Any help
would be greatly appreciated!

	Also could you please send any response via mail as I do not have
any news running at this time... I'm trying to get cnews up. 
	damian@wshb.csms.com
Thanks
Damian

this is the t2 output from running a post news: 

PATH=/usr/lib/news/bin:/usr/lib/newsbin:/bin:/usr/bin:/usr/local/bin  umask=002
server=/usr/lib/news
server=wshb.csms.com  me=wshb.csms.com
head off special case = 1
case #2=articles  dfunit=512
 df argument= /usr/spool/news NR= nr= NF= nf=
 df argument= /usr/spool/news NR= nr= NF= nf=

spacefor... below

#! /bin/sh
# spacefor - determine available disk space
# About how many things of $1 bytes will fit in the available space for
# stuff of type $2 ("incoming", "articles", "control", "outbound $3",
# or "archive") without cramping things too badly?
#
# You'll have to change this -- your blocksize, minimum-free-desired amounts,
# and df output format will probably differ, and you may need to name
# your filesystems explicitly.

# =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
. ${NEWSCONFIG-/usr/lib/news/bin/config}

PATH=$NEWSCTL/bin:$NEWSBIN:$NEWSPATH ; export PATH
umask $NEWSUMASK
echo "PATH=$PATH  umask=$NEWSUMASK" >> t2

# punt to server if necessary
if test -r $NEWSCTL/server
echo "server=$NEWSCTL" >> t2
then
	server="`cat $NEWSCTL/server`"
	me="`hostname`"
	echo "server=$server  me=$me" >> t2
	if test " $server" != " $me"
	then
		exec rsh $server -n /bin/sh -c "'PATH=$PATH `basename $0` $*'"
		# does not return
	fi
fi

# head off special case
echo "head off special case = $1" >> t2
case "$1" in
0)	echo 10000 ; exit 0 ;;
esac

# argument to df, df units, and free space desired (in df units)
dfunit=512			# default df unit (bytes)
echo "case #2=$2  dfunit=$dfunit" >> t2
case "$2" in
incoming)	arg="$NEWSARTS/in.coming" ; desire=5000 ;;
articles)	arg="$NEWSARTS" ; desire=5000 ;;
control)	arg="$NEWSCTL" ; desire=3000 ;;		# for expire, mostly
outbound)	arg="/usr/spool/uucp" ; desire=10000 ;;	# ignore $3
archive)	arg="$NEWSARTS" ; desire=1 ;;		# system-specific
*)		echo "$0: bad type argument \`$2'!!" >&2
		exit 2 ;;
esac

# In the following, the initialization of nf determines which field the
# block count comes from, and the one for nr determines which line.  For
# System V, the Makefile edits in a sed which tries to strip silliness
# off in a reasonably System-V-variant-independent way.  Expr would be
# faster than awk, but on a 16-bit machine, expr does 16-bit arithmetic,
# which isn't enough.

# this is set up for the stupid System V df
echo " df argument= $arg NR=$NR nr=$nr NF=$NF nf=$nf" >> t2
df $arg | sed "s/.*:/: :/" | awk "BEGIN { nf = 3 ; nr = 2 }
	NR == nr && NF >= nf {
		nb = (\$nf - $desire) * $dfunit / $1
		if (nb > 10000)
			nb = 10000	# ensure representable as integer
		nb = int(nb)
		if (nb <= 0)
			print 0
		else
			print nb
		exit
	}
	NR == nr && NF < nf {		# idiotic Berkeley continuation
		nr += 1
		nf -= 1
	}"
echo " df argument= $arg NR=$NR nr=$nr NF=$NF nf=$nf" >> t2
-- 
       Damian L. Centgraf II        | "Use the key unlock the door" 
     WSHB-System Administrator      | "See what your fate might have in store" 
      WSHB-Broadcast Engineer       | "Come explore your dreams creation"
 INTERNET ...damian@wshb.csms.com   | "Enter this world of imagination" -Rush
Technical Details
Message-ID: <1994Feb28.115108.26024@wshb.csms.com>
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!netnews.upenn.edu!msuinfo!agate!howland.reston.ans.net!sol.ctr.columbia.edu!news.kei.com!uuspew.uu.net!uunet!wshb!damian

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f8c9b,f95cb4c7d46129fe,start
X-Google-Attributes: gidf8c9b,public
X-Google-Thread: 10e254,f95cb4c7d46129fe,start
X-Google-Attributes: gid10e254,public
X-Google-Thread: 10d020,f95cb4c7d46129fe,start
X-Google-Attributes: gid10d020,public
X-Google-Thread: 1122ea,f95cb4c7d46129fe,start
X-Google-Attributes: gid1122ea,public
X-Google-ArrivalTime: 1994-02-28 03:51:08 PST
Newsgroups: news.software.b,news.software.nntp,biz.sco.general,comp.unix.questions
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!netnews.upenn.edu!msuinfo!agate!howland.reston.ans.net!sol.ctr.columbia.edu!news.kei.com!uuspew.uu.net!uunet!wshb!damian
From: damian@wshb.csms.com (Damian Centgraf - WSHB System Administrator - Engineer)
Subject: CNEWS Spacefor problems (CNEWS2)
Organization: Herald Broadcasting Syndicate, Inc. Cypress Creek, SC
Date: Mon, 28 Feb 94 11:51:08 GMT
Message-ID: <1994Feb28.115108.26024@wshb.csms.com>
Lines: 132