Upgrading TinyMUSH 3.0 to 3.1

I logged onto the MUSH as god and issued the command version to check the current version of the TinyMUSH software.


TinyMUSH version 3.0 patchlevel 4 #1 [05/08/2002]
Build date: Tue Nov 11 18:14:32 EST 2003
Build info: gcc   -g -O  -DPUEBLO_SUPPORT -DUSE_COMSYS -DUSE_MAIL -DFLOATING_POINTS

Since the version was outdated, I shut down the MUSH with the @shutdown command.

Since the current version is TinyMUSH 3.1 patchlevel 4, I downloaded it. I then unzipped and untarred the file.

gunzip tmp31p4.tar.gz
tar -xvf tm31p4.tar

I then changed the working directory to the tinymush-3.1p4 directory and issued the Build command to compile the software.

cd tinymush-3.1p4
./Build

I made an archive file of the 3.0 version of the MUSH with the ./Archive command.

$ ./Archive
Opening ./data/moondreaming.gdbm
Done opening ./data/moondreaming.gdbm.
Reading ............................
Input: TinyMUSH-3 version 1: Zone Link GDBM AtrName AtrKey Parent AtrMoney ExtFlags MoreFlags Powers QuotedStr TypedQuotas
Output: TinyMUSH-3 version 1: Zone Link Parent ExtFlags MoreFlags Powers QuotedStr TypedQuotas
Writing .......
Archiving...
moondreaming.flat.0310-1848
./data/comsys.db
./data/mail.db
mush.config
moondreaming.conf
./text/badsite.txt
./text/connect.txt
./text/create_reg.txt
./text/down.txt
./text/full.txt
./text/guest.txt
./text/htmlconn.txt
./text/motd.txt
./text/news.txt
./text/newuser.txt
./text/quit.txt
./text/register.txt
./text/wizmotd.txt
./text/wiznews.txt
Done.

That created a file moondreaming-archive.0310-1848.tar.gz.

I then changed the working directory to the one for the 3.1 version of TinyMUSH with cd tinymush-3.1p4/game and created a backup of the default configuration file for that version with mv mush.config mush.config.default. I then inflated the archive file I made earlier, putting its contents into the 3.1 directory.

$ gzip -dc ~/tinymush/moondreaming/moondreaming-archive.0310-1848.tar.gz | tar -xvf -
moondreaming.flat.0310-1848
./data/comsys.db
./data/mail.db
mush.config
moondreaming.conf
./text/badsite.txt
./text/connect.txt
./text/create_reg.txt
./text/down.txt
./text/full.txt
./text/guest.txt
./text/htmlconn.txt
./text/motd.txt
./text/news.txt
./text/newuser.txt
./text/quit.txt
./text/register.txt
./text/wizmotd.txt
./text/wiznews.txt

The instructions suggest that if you are given the option to overwrite files that you should do so, but I was not prompted to overwrite any files.

I then edited mush.config.default and replaced the following lines with the values from the mush.config file from the 3.0 directory.

GAMENAME=netmush
OWNER=mush_admin@your_site.your_domain

I then overwrote the mush.config file with the mush.config.default file with mv -f mush.config.default mush.config.

The upgrade instructions, which can be found in the INSTALL file then state that you should look for the following parameters in your GAMENAME.conf, in this case moondreaming.conf, file and remove them.


    cache_depth
    cache_width
    input_database
    output_database
    mail_database
    comsys_database
    have_comsys
    have_mailer
    format_exits
    format_contents

I found the following lines in moondreaming.conf:


#
input_database  data/moondreaming.db
output_database data/moondreaming.db.new
crash_database  data/moondreaming.db.CRASH
gdbm_database   data/moondreaming.gdbm
#
# -- Mail and comsys databases.
#
mail_database   data/mail.db
comsys_database data/comsys.db

I removed all of those, except for the crash_database and gdbm_database lines. I added the lines below:

module comsys
module mail

Since the database files had been in the data directory for the 3.0 version of the game, I added the line database_home data. I also removed the "data/" from the following lines:

crash_database data/moondreaming.db.CRASH
gdbm_database data/moondreaming.gdbm

I then saved the conf file and converted the database to the new 3.1 format with the Restore command.

$ ./Restore moondreaming.flat.0310-1848
This archive appears to be uncompressed... okay.
Moving old files out of the way. Please ignore file-not-found warnings.
mv: can't stat source ./data/moondreaming.gdbm
mv: can't stat source ./data/moondreaming.db.CRASH
mv: can't stat source ./data/moondreaming.db.bk
mv: can't stat source ./data/mod_*.db
Restoring flatfile.
Loaded module: comsys
Loaded module: mail
Using gdbm file: ./data/moondreaming.gdbm
Reading ............................
Input: TinyMUSH-3 version 1: Zone Link Parent ExtFlags MoreFlags Powers QuotedStr TypedQuotas
Output: TinyMUSH-3 version 1: Zone Link GDBM AtrName AtrKey Parent AtrMoney ExtFlags MoreFlags Powers QuotedStr TypedQuotas Timestamps VisualAttrs
Writing .......

I then renamed the comsys and mail databases to the new 3.1 names.

cd data
mv comsys.db mod_comsys.db
mv mail.db mod_mail.db

I then started the MUSH with ./Startmush.

$ cd ..
$ ./Startmush
[1] 27572
./Startmush: line 83: [: : integer expression expected
[amy@frostdragon game]$ Indexing help.txt
1004 topics indexed
Indexing mushman.txt
395 topics indexed
Indexing news.txt
line 5: line too long
line 7: line too long
line 9: line too long
line 11: line too long
line 13: line too long
line 17: line too long
line 19: line too long
line 21: line too long
line 23: line too long
line 25: line too long
line 27: line too long
line 41: line too long
line 43: line too long
line 45: line too long
line 47: line too long
line 49: line too long
line 86: line too long
line 87: line too long
line 207: line too long
line 210: line too long
line 261: line too long
line 263: line too long
line 268: line too long
line 313: line too long
line 320: line too long
line 322: line too long
line 325: line too long
line 327: line too long
line 585: line too long
line 587: line too long
line 589: line too long
line 591: line too long
line 593: line too long
line 595: line too long
line 597: line too long
line 795: line too long
line 797: line too long
line 799: line too long
line 801: line too long
line 803: line too long
line 809: line too long
line 818: line too long
line 824: line too long
line 840: line too long
line 842: line too long
line 844: line too long
line 846: line too long
line 848: line too long
line 850: line too long
line 852: line too long
line 854: line too long
line 856: line too long
line 875: line too long
line 880: line too long
76 topics indexed
Indexing plushelp.txt
4 topics indexed
Indexing qhelp.txt
18 topics indexed
Indexing wizhelp.txt
379 topics indexed
Indexing wiznews.txt
1 topics indexed
Checking for database files and creating backups of old files.
tail: moondreaming.log: No such file or directory
Saving old comsys module db.
Saving old mail module db.
ls: moondreaming.log.*: No such file or directory
No previous game log.
Log cleanup done.
Process 27676
070310.210614 TinyMUSH INI/START: Starting: TinyMUSH version 3.1 patchlevel 4 #1 [10/11/2006]
070310.210614 TinyMUSH INI/START: Build date: Sat Mar 10 20:53:07 EST 2007
070310.210614 TinyMUSH INI/START: Build info: ./configure
            gcc   -g  -I./gdbm-1.8.0
070310.210614 TinyMUSH CNF/MOD  : Loaded module: comsys
070310.210614 TinyMUSH CNF/MOD  : Loaded module: mail
070310.210614 MoonDreamingMUSH INI/LOAD : Using gdbm file: moondreaming.gdbm
070310.210614 MoonDreamingMUSH INI/LOAD : Loading object structures.
070310.210614 MoonDreamingMUSH INI/LOAD : Loading db: data/mod_mail.db
070310.210614 MoonDreamingMUSH INI/LOAD : Loading db: data/mod_comsys.db
070310.210614 MoonDreamingMUSH INI/LOAD : Load complete.
070310.210614 MoonDreamingMUSH CFG/UPDAT: God(#1) entered config directive: money_name_singular with args 'Moon Coin'. Status: Success.
070310.210614 MoonDreamingMUSH CFG/UPDAT: God(#1) entered config directive: money_name_plural with args 'Moon Coins'. Status: Success.
070310.210614 MoonDreamingMUSH INI/LOAD : Startup processing complete.
070310.210614 MoonDreamingMUSH NET/SLAVE: DNS lookup slave started on fd 1
070310.210614 MoonDreamingMUSH INI/LOAD : Cleanup completed.

Since there appeared to be an error on line 83 in the Startmush file, I checked that line in the Startmush file and found the following:


#
#       Get the current status of the MUSH.
#
if [ -r "$PIDFILE" ]; then
        oldpid=`cat $PIDFILE`
        if [ "$oldpid" -gt 1 ]; then
                nmush=`ps | grep $oldpid | grep netmush | wc -l`
        fi
fi

The script is checking to see whether the file represented by the variable $PIDFILE exists and, if so, assigning the process ID found in that file to the variable oldpid.

I looked in the mush.config file and found the line PIDFILE=$GAMENAME.pid. There was no such file on the system, i.e. in this case there was no moondreaming.pid.

What happens if that file containing a process ID for the MUSH doesn't exist? You get the error referring to "integer expression expected". It is nothing to be concerned about, since it will only occur if the PID file doesn't exist and the MUSH will start anyway. The gamename.pid file will be created when the MUSH starts.

References:

  1. TinyMUSH 3: The Home Page
  2. MUSH
    Wikipedia, the free encyclopedia