[comp.unix.microport] Is anyone executing Cnews on microport 2.4 ?

cab@cbnewsh.ATT.COM (CAB) (07/04/89)

Tips on compilation appreciated, my compiler seems to barf
on relay/hdrdefs.c line 49.  The error message is

compiler error: expression causes compiler loop: try simplifying

Thanx
-- 
          -CAB-        
   _____/ _ || _\___   
 lNYCl_  ______   __|) Standard disclaimer.
   ==  (0)     (0)     

root@pfm.UUCP (TSOS of PFM) (07/08/89)

cab@cbnewsh.ATT.COM (CAB) writes:

>Tips on compilation appreciated, my compiler seems to barf
>on relay/hdrdefs.c line 49.  The error message is

>compiler error: expression causes compiler loop: try simplifying

No, sorry, I have the microport sys V 386 Rel. 3.0, but I have 
trouble with the "spacefor" - the whole time inews says that there
is not enough space at my /usr/spool/news (32 MB free space !).

Anybody with the same problem ? 
-- 
 _ __   _____  _ _ _                         | uucp: uunet!mcvax!unido!pfm!root
' )  )   /  ' ' ) ) )Oberer Moenchelenweg 2  |-------------------------------- 
 /--' ,-/-,    / / / D-7300 Esslingen/Neckar | Hotline: *49 711 3701830
/    (_/      / ' (_ West Germany            | from 08:00am to 08:00pm MEZ

dave@micropen (David F. Carlson) (07/10/89)

In article <14@pfm.UUCP>, root@pfm.UUCP (TSOS of PFM) writes:
> No, sorry, I have the microport sys V 386 Rel. 3.0, but I have 
> trouble with the "spacefor" - the whole time inews says that there
> is not enough space at my /usr/spool/news (32 MB free space !).

Often news fails with out of space messages if the inode table is full.
The SV/386 with release < 3.2.1 will have the infamous inode bug
which will report out of inodes incorrectly.  Use df -t to see.  The only
*real* fix is to upgrade or to mkfs.  Fsck fixes are only temporary.

-- 
David F. Carlson, Micropen, Inc.
micropen!dave@ee.rochester.edu

"The faster I go, the behinder I get." --Lewis Carroll

dr@myrias.uucp (Dragos Ruiu) (07/12/89)

In article <14@pfm.UUCP> root@pfm.UUCP (TSOS of PFM) writes:
>cab@cbnewsh.ATT.COM (CAB) writes:
>
>>Tips on compilation appreciated, my compiler seems to barf
>>on relay/hdrdefs.c line 49.  The error message is
>
>>compiler error: expression causes compiler loop: try simplifying
>
>No, sorry, I have the microport sys V 386 Rel. 3.0, but I have 
>trouble with the "spacefor" - the whole time inews says that there
>is not enough space at my /usr/spool/news (32 MB free space !).
>
>Anybody with the same problem ? 
>-- 
 
  Henry Spencer posted a suggested fix for the Cnews problem on Uport SysV/AT.
  Basically, the offsetof() macro breaks PCC compilers. On microport you
  can simplify the expression by removing the first cast and the subtraction
  since the program will be compiled in the small memory model. Klugey but
  it works.

  Cnews works *GREAT* on microport 286-2.4!

  You have to fix spacefor however. The SysV.2 df does not take arbitrary
directories for arguments. It is relatively trivial to fix it up, but
it is site specific because you need to know about how you set up your file
systems. I'm including spacefor off my system at the end of this posting.
It is a slightly trimmed down version od the original. 
  On my system /usr/spool is a separate disk drive, so to change this to
work on your system you should make the argument to df be whatever filesystem
you spool stuff on. (Typically /usr on uPort setups) 
  If you spool news and uucp stuff on different filesystems, you would be
better off starting with the stock spacefor and modifying it.
  The only other caveat is that I put my news stuff in /usr/local/lib, so
if you put things in /usr/lib (blech...) you'll have to change the line
that looks for the config file. 
  
  Spacefor follows signature...
--
Dragos Ruiu         | GNU Emacs: It's a tool.
alberta!dragos!ruiu | Me: When you have a hammer, everything looks like a nail! 
uunet!myrias!dr     |
bbs: (403) 439-0229 |
################################################################################
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	spacefor.uport
# This archive created: Tue Jul 11 12:35:32 1989
export PATH; PATH=/bin:$PATH
if test -f 'spacefor.uport'
then
	echo shar: will not over-write existing file "'spacefor.uport'"
else
cat << \SHAR_EOF > 'spacefor.uport'
:
# 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/local/lib/news/bin/config}
 
PATH=$NEWSCTL/bin:$NEWSBIN:$NEWSPATH ; export PATH
umask $NEWSUMASK

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

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

# this is set up for the stupid SysV.2 df as opposed to the stupid BSD df :-)
df /usr/spool | awk "{
                nb = (\$2 - $desire) * $dfunit / $1
                if (nb > 10000)
                        nb = 10000      # ensure representable as integer
                nb = int(nb)
                if (nb <= 0)
                        print 0
                else
                        print nb
                exit
        }"

SHAR_EOF
fi # end of overwriting check
#	End of shell archive
exit 0
-- 
Dragos Ruiu          What do you get when you cross a grape with an elephant ?
myrias!dr                        Grape Elephant Sine Theta

mann@intacc.uucp (Jeff Mann) (07/12/89)

In article <773@micropen> dave@micropen (David F. Carlson) writes:
>In article <14@pfm.UUCP>, root@pfm.UUCP (TSOS of PFM) writes:
>> trouble with the "spacefor" - the whole time inews says that there
>> is not enough space at my /usr/spool/news (32 MB free space !).
>
>Often news fails with out of space messages if the inode table is full.
...
>The only *real* fix is to upgrade or to mkfs.  Fsck fixes are only temporary.

Another  posting  also  suggested  making  the  raw disk readable, not a
particularly good idea for security  reasons  I  would  think.   Drastic
measures for a simple problem; it is probably just that "spacefor" needs
a  little  customising  to  handle the uport df command.  First you must
change the arguments to df for incoming, articles, etc.  to only specify
the  filesystem,  i.e.   /usr,  instead  of   the   path   names,   i.e.
/usr/spool/news,  etc.   Secondly,  change the awk statement to read awk
"BEGIN { nf = 3 ; nr = 1 }       ( nr to equal one instead of two).

David  is  correct  to  point out that the "infamous" indode problem can
happen with Microport.  I think a preventative fix for this would be  to
add a line:

	> $NEWSARTS/tmp$$; rm $NEWSARTS/tmp$$

to  newsrun,  just before the test for request to stop in the main loop,
for example.  This will stop the creation of thousands of files  without
a  deletion  of a file; which I believe is the condition that causes the
missing inodes.  Comments?

Also  of  interest to Microport users: batch/viauux calls uux with a -gd
option, not recognised by uport.  Just take it  out.   Related  is  that
conf/queuelen,  either  version,  does  not work.  I used the 'old uucp'
version, and removed the part about changing directories.  The length of
the $site should be reduced from 7 characters to 6 (remove one  ?   from
the  case  statement,  and  one  .  from the expr statement.  The $grade
should (I think) be changed from d to AD.

Now let's see if this article makes it to the net with my new C news! :-)


-- 
| Jeff Mann - Inter/Access, Toronto           ...uunet!mnetor!intacc!mann  |
| "A picture is worth 256 thousand words"  {utzoo, utgpu}!chp!intacc!mann  |

henry@utzoo.uucp (Henry Spencer) (07/13/89)

In article <1989Jul12.060459.28245@intacc.uucp> mann@intacc.UUCP (Jeff Mann) writes:
>David  is  correct  to  point out that the "infamous" indode problem can
>happen with Microport.  I think a preventative fix for this would be  to
>add a line:
>
>	> $NEWSARTS/tmp$$; rm $NEWSARTS/tmp$$
>
>to  newsrun,  just before the test for request to stop in the main loop,
>for example.  This will stop the creation of thousands of files  without
>a  deletion  of a file; which I believe is the condition that causes the
>missing inodes.  Comments?

I would be quite interested to know whether this does in fact solve the
problem; I'm a little sensitive to overhead in newsrun, but I could at
least say something about it in a comment.

I considered having spacefor try to check for inodes as well as disk
blocks, in fact, but if you thought finding the number of disk blocks
free was system-dependent, well, inodes are worse...

>Also  of  interest to Microport users: batch/viauux calls uux with a -gd
>option, not recognised by uport.  Just take it  out.   Related  is  that
>conf/queuelen,  either  version,  does  not work.  I used the 'old uucp'
>version, and removed the part about changing directories...

My stars, that's an ancient uucp!
-- 
$10 million equals 18 PM       |     Henry Spencer at U of Toronto Zoology
(Pentagon-Minutes). -Tom Neff  | uunet!attcan!utzoo!henry henry@zoo.toronto.edu

allbery@ncoast.ORG (Brandon S. Allbery) (07/13/89)

As quoted from <14@pfm.UUCP> by root@pfm.UUCP (TSOS of PFM):
+---------------
| cab@cbnewsh.ATT.COM (CAB) writes:
| >Tips on compilation appreciated, my compiler seems to barf
| >on relay/hdrdefs.c line 49.  The error message is
| >compiler error: expression causes compiler loop: try simplifying
+---------------

Some compilers aren't capable of handling complex expressions.  And some
expressions that look rather complex to the compiler look downright simple
to us people, because some combination of two or three operators turns out
to require a lot of work on the part of the compiler to implement.

The error message says exactly what it means:  look at line 49 of
relay/hdrdefs.c, find the expression that's causing the problem, and split
it up by storing temporary results in variables.

+---------------
| No, sorry, I have the microport sys V 386 Rel. 3.0, but I have 
| trouble with the "spacefor" - the whole time inews says that there
| is not enough space at my /usr/spool/news (32 MB free space !).
+---------------

The release notes warn that "spacefor" WILL need to be adjusted for a given
system....

Whoever wrote the System V code for "spacefor" assumed that the device name
always fits exactly between the parentheses.  This is not always true.  I
just hardcoded for our system (needed a quick fix, "doexpire" was hammering
its head against the wall), but a better way to extract the free space is:

df something | sed '/^[^(]*([^ ][^ ]* *): *\([0-9][0-9]*\) *b.*$/s//\1/'

This should work on any System V and also works with the (slightly
different) System III df.  (Well, let me hedge that:  it works with System
III df, because I tested it just now.  However, ncoast is not (yet) System V
so I can't test it under System V right now.  I'll test it on the 386 at
work tomorrow and let you know what needs to be changed.)

++Brandon
-- 
Brandon S. Allbery, moderator of comp.sources.misc	     allbery@ncoast.org
uunet!hal.cwru.edu!ncoast!allbery		    ncoast!allbery@hal.cwru.edu
      Send comp.sources.misc submissions to comp-sources-misc@<backbone>
NCoast Public Access UN*X - (216) 781-6201, 300/1200/2400 baud, login: makeuser
* "ncoast" regenerates again!  The 5th "ncoast", coming August 1 (stay tuned) *