Need to patch inews/rnews so it will watch for inode underflow

Jon Zeeff zeeff at b-tech.ann-arbor.mi.us
Mon Feb 20 02:08:06 AEST 1989


If you are running out of inodes, you should mkfs with more or, if it's
the inode bug, fix it.  But this script will help.


#
# This demon script (uukill) watches for a lack of space and kills incoming o
# uucico jobs when space is low.
# This is done to prevent a site from sending
# more usenet news than this system can handle.
# Written for HDB uucp.  Non HDB uucp systems may be able to get the pid
# from the TM file name.
#
# Run from /etc/inittab with:
#
#    uk:23:respawn:/etc/uukill
# 
#                        - Jon Zeeff   umix!b-tech!zeeff

PATH=/bin:/usr/bin:/usr/lbin
ADMIN=zeeff

sleep 200
cd /usr/spool/uucp

while true
do
   
      set `df /`
      FREE=$4
      SPOOLFREE=$6
      set `df /usr/spool/news`
      IFREE=$4
      SPOOLIFREE=$6

      if [ $FREE -lt 1500 -o $SPOOLFREE -lt 2000 -o $IFREE -lt 200 -o $SPOOLIFREE -lt 200 ]
         then

         # kill the jobs with LCK files and TM files 
         for i in `uuname`
         do
	    if test -f /usr/spool/locks/LCK..$i && /bin/ls $i/TM*  
            then
               kill `cat /usr/spool/locks/LCK..$i`
            fi 2> /dev/null > /dev/null
         done

         if test ! -f /tmp/full
         then
              echo "Killing uucp - disk is full" > /tmp/full
              df >> /tmp/full
              mail $ADMIN < /tmp/full
         fi
      fi
 
   sleep 500
done

-- 
  Jon Zeeff			zeeff at b-tech.ann-arbor.mi.us
  Ann Arbor, MI			mailrus!b-tech!zeeff



More information about the Comp.unix.microport mailing list