Subject: Moo on NeXT

From: [email-masked] (Jonathan Bradshaw)
Date: Thu, 5 Nov 1992 13:59:52 -0800

Anyone who has run the MOO 1.7.0 on a NeXT machine without getting 
vm_allocate errors please email me. I am trying to isolate the cause.

-- 
 Jonathan Bradshaw | [email-masked] -or- [email-masked]
  Packet: n9oxe@n0ary.#nocal.ca.usa.na | Prodigy: XMSN02B | (Os/2)(DOS)(Linux)
  WNDU-AM/FM/TV South Bend, IN | Disclaimer "My opinions are not my employers"
  - "Busy life, not enough time to look in the mirror." - Deborah Ann Gibson -

---

From: Pavel Curtis <[email-masked]>
Date: Thu, 5 Nov 1992 14:34:59 -0800

[I'm responding to Jonathan on the list since others might benefit from the
answer.]

I believe that somebody else found that these errors (indicating that the
server has used up more memory than the OS is willing to give it) were caused
by defining LOG_COMMANDS in options.h and then using a long $dump_interval (24
hours).  Since the server is then keeping (in memory) a copy of every single
command typed by any player over a 24-hour period, each one with a ~20
character time stamp on the front, this appeared to be a good way to run out of
memory.  If this describes your set-up, I'd recommend turning off LOG_COMMANDS,
reducing $dump_interval to something like 3600 (one hour), or both.

	Pavel/Haakon

---

From: [email-masked] (Jonathan Bradshaw)
Date: Thu, 5 Nov 1992 15:31:56 -0800

> reducing $dump_interval to something like 3600 (one hour), or both.

I have turned off command logging and dump every 4 hours or less. This has
generally decreased the number of frequency of the crashes but has not
fixed the problem. Today, a crash happened 5 hrs after I restarted the
server. The Moo is started by a "Reinit" csh script file on a 68040 NeXT
slab with 16mb of memory and a swapfile on a drive with 80MB free. There
are only two users - one console and one tty. Crashes can occour at any
time with no prediction. They can occour using the KILL -USR1 command to
make a database dump or by themselves. Sometimes, one can get a crash
after allocating a large amount of memory such as for @display on a large
(help DB) for example but it is not repeatable. The following is my reinit
code: (its not pretty but it does work). The crashes can happen when one
or more people are using the MOO or when a dump is requested.

--CUT HERE--
#! /bin/csh
# This file is used to bring up the Moo or down it and restart
# It checks for a DUMP file and both DBASE and DBASE.ZIP files.
# It can  be used interactively or in a crontab.

nice +20
cd /jonathan/Moo
set dbase=void
set dump=dump
set kernel=mookernd
set moopid=`ps -cx | grep "$kernel"`

if ( $#moopid != 0 ) then
  echo "Void is running. Bringing it down at `date`"
  echo "`date`: Sent shutdown (KILL -USR1) $moopid[1]" >> $dbase.log
  kill -USR1 $moopid[1]
  while ( $#moopid != 0 )
    sleep 60
    echo "  Waiting for MUD to dump at `date` ..."
    set moopid=`ps -cx | grep "$kernel"`
  end
else
  echo "Void is not running at `date`"
endif

# Check for a dump file (if the moo was up it should have one)
if ( -r $dump ) then
  set line=`tail -1 $dump`
  if ( "$line" =~ *suspended* ) then
    echo "  Valid $dump - moving to $dbase"
    mv -f $dump $dbase
    echo "  Creating backup zip file of $dbase ...."
    /NovaBin/zip $dbase.zip $dbase
    echo "  Compressing log file ..."
    cat $dbase.log >> $dbase.log.all
    cat /dev/null > $dbase.log
    tail -1000 $dbase.log.all > $dbase.log.tmp
    mv -f $dbase.log.tmp $dbase.log.all
    echo "  Sending database to IRISHMVS storage account ..."
    set ftp_cmd	= "ftp -n backupsite"
    set total_size  = `cat void.zip void.log.all | wc -c`
    echo "    Total transfer size is $total_size bytes."
    if ( $total_size < 100000 ) then
      echo "      UH - I DON'T THINK THIS IS CORRECT LESS THAN 1MB"
    else
      if ( $total_size >= 5000000 ) then
        echo "      OH SMEG - TOTAL SIZE TOO LARGE TO BACKUP TO ACCOUNT"
      else
        echo "user me password"       > ftp.get
        echo "bin"                    >> ftp.get
        echo "delete void.zip"	      >> ftp.get
        echo "send void.zip"          >> ftp.get
        echo "delete void.log.all"    >> ftp.get
        echo "send void.log.all"      >> ftp.get
        echo "bye"                    >> ftp.get
        $ftp_cmd < ftp.get
        rm -f ftp.get
        echo "    Complete."
      endif
    endif
  else
    echo "  WARNING: $dump not valid. Moving to $dump.BAD"
    mv -f $dump $dump.BAD
  endif
else
  echo "  No $dump file found."
endif

# Now lets bring thevoid up

echo "RESTART $dbase at `date`" 

# Check for a database file - should be one from dump but in case
# the dump was bad we need to have a way of getting the old version

if (! -r $dbase) then
  if (-r $dbase.zip) then
    echo "  Can't find $dbase, unzipping $dbase.zip ..."
    /NovaBin/unzip $dbase.zip
  else
    echo "  Can't find $dbase or $dbase.zip - aborting"
    exit 1
  endif
else
  echo "  Found $dbase."
endif

set line=`tail -1 $dbase`
if ( "$line" =~ *suspended* ) then
  echo "  Checking: $dbase is valid."
else
  echo "  WARNING: Problem with $dbase - renaming and aborting!"
  mv -f $dbase $dbase.BAD
  exit 1
endif

echo `date`: RESTARTED >> $dbase.log
echo -n "  Starting Moo process as "
$kernel $dbase $dump >>& $dbase.log &
echo "COMPLETED restart at `date`"
exit 0

---CUT HERE---

By the way, improvements to the above are welcome. It is run every morning
by cron at 5am and can be run at any time by myself. It works great for me.

How long before the disk version Pavel? <grin> Maybe this will solve it!