startup problems

Posted by Samryn on Wed 27 Jun 2007 01:03 AM — 31 posts, 115,194 views.

United Kingdom #0
Whenever i try to startup the mud using ./startup &
I recieve this error... im clueless when it comes to the startup part of SMAUG, any suggestions guys?

dreamer@dreams.slayn.net [~/SMAUG/src]# ./startup: line 4: syntax error near unexpected token `set'
'/startup: line 4: `if ( "$1" != "" ) set port="$1"


my startup is the following:

#! /bin/csh -f
# Set the port number.
set port = 6767
if ( "$1" != "" ) set port="$1"
# Change to area directory.
cd ../area
# Set limits.
limit coredumpsize unlimited
limit stacksize unlimited
if ( -e shutdown.txt ) rm -f shutdown.txt
while ( 1 )
  # If you want to have logs in a different directory,
  #   change the 'set logfile' line to reflect the directory name.
  set index = 1000
  while ( 1 )
  set logfile = ../log/$index.log
  if ( ! -e $logfile ) break
  @ index++
  end
  # Record starting time
  date > $logfile
  date > ../area/boot.txt
  # Run SMAUG.
  # Check if already running
  set matches = `netstat -an | grep ":$port " | grep -c LISTEN`
  if ( $matches >= 1 ) then
      # Already running
      echo Port $port is already in use.
      exit 0
  endif
  ../src/smaug $port >&! $logfile
  # Restart, giving old connections a chance to die.
  if ( -e shutdown.txt ) then
  rm -f shutdown.txt
  exit 0
  endif
  sleep 5
end


Thanks guys
USA #1
You might not have tcsh installed. I'm assuming you are running under Linux from the prompt hostname; if you have a Debian-based system, you should do "apt-get install tcsh". From a Fedora system, it'd be something like "yum install tcsh".

I suspect that you have the basic csh installed and it doesn't like the syntax in line 4.
USA #2
I thought slayn.net was a mud host.. seems unlikely they'd not have tcsh installed. :(

On the other hand, I can't see, off-hand, anything else likely to be the culprit on this one either. :(
USA #3
Oh, I didn't realize that... If it really is a shared MUD host administered by somebody else, there is something of a problem here. :-)

You could try adding spaces around the equal sign to match the other examples in the startup script.
United Kingdom #4
I tried the putting spaces around the equal signs with no success, hmmm.

If on the first line there isn't a space before "#! /bin/csh -f", i had a different error message. Could this be effecting it?

The different error message that i had before was:

'reamer@dreams.slayn.net [~/SMAUG/src]# Unknown option: `-
Usage: csh [ -bcdefilmnqstvVxX ] [ argument ... ].


Thanks for the help.
Amended on Wed 27 Jun 2007 08:49 PM by Samryn
USA #5
Strange, I've seen many Smaug MUDs run on Slayn. Try emailing the admin, make sure it's installed.
USA #6
You don't want to touch the first line; it's fine as it is. If anything csh should be changed to tcsh, but no more spaces are necessary.

Try typing csh --version or csh -v or something like that to get the version of csh that's running. If it says csh and not tcsh that is probably the problem.
United Kingdom #7
When i typed that in i got this back from the server:

tcsh 6.13.00 (Astron) 2004-05-19 (i386-intel-linux) options 8b,nls,dl,al,kan,rh,color,dspm,filec


this is crazy :|
USA #8
OK, troubleshoot mode then. :-)

Which distribution is this startup script from? Did you change anything whatsoever? Is the startup script exactly the same as the one in the distribution archive? Have you tried other distributions?
United Kingdom #9
SmaugFUSS 1.8
Apart from the space at the beginning to stop that other error...

It worked in CygWin before i ported the mud over to the host.

Yup, aint changed nothing apart from put the space at the beginning thing like explained before.

Nope aint tried another one =)
USA #10
Maybe try the startup file from Smaug 1.4a?
United Kingdom #11
ok... so now i've tried to use 1.4a but i get another thing now and i aint even sure if this is to do with startup?

dreamer@dreams.slayn.net [~/SMAUG/src]# ./startup &
[1] 5325
dreamer@dreams.slayn.net [~/SMAUG/src]# *** glibc detected *** double free or corruption (!prev): 0x09dc91e8 ***
Abort

it seems like its actually running it, but im getting this glibc detected? :S
USA #12
Try using gdb to find out what is going on.
United Kingdom #13
errr never really had to use gdb... how would i get it to debug for startup? =/ sorry =(
USA #14
cd area
gdb ../src/smaug
(wait for crash)
backtrace

That should get you started at least. You should also check out Nick's guide to debugging in gdb: http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=3653
United Kingdom #15
Ok... either i've done this completely wrong. Or i've just recieved the same message in GDB. Sorry if its me ::twitch::

GNU gdb Red Hat Linux (6.3.0.0-1.132.EL4rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) *** glibc detected *** double free or corruption (!prev): 0x089ca1e8 ***
Abort
USA #16
What does the backtrace say?
United Kingdom #17
No stack. :S
I'm guessin i'm to fault here?
USA #18
Did you compile the code from scratch on the server you're running on? If you compiled it on a home machine and then uploaded it, there might be machine architecture problems. Or C library problems. Or something. In any case, it's a good idea to recompile on the server.
USA #19
What did you do, exactly? (To run gdb)
United Kingdom #20
Yeh, i cleaned up all the *.o files before i uploaded it to the host. Then compiled it when i was over there, i had to modifiy the makefile abit to work on the host, but then i thought everything would have been ok.



I typed in:

./startup &
cd ..
cd area
gdb ../src/smaug
waited for the error
backtrack
q
ps
kill 3102
USA #21
Uh... You're running two MUDs then. There's no need to start the startup script if you are going to run the MUD via gdb. You also didn't run the MUD. When you enter gdb, type run.
United Kingdom #22
when i type in run i get:

Starting program:
No executable file specified.
Use the "file" or "exec-file" command.


meh, im so sorry bout bein such a pain in the ass :| these scripts are something im crap at... coding, i can do (to a point i might add). scripts... meh :|
USA #23
Did you read the gdb guide?

You should be able to select the exec.
United Kingdom #24
right got is... sorry.



(gdb) run
Starting program: /home/dreamer/SMAUG/src/smaug
Wed Jun 27 17:32:07 2007 :: Booting Database
 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Wed Jun 27 17:32:07 2007 :: [*****] BOOT: ---------------------[ Boot Log ]--------------------
Wed Jun 27 17:32:07 2007 :: Initializing libdl support...
Wed Jun 27 17:32:07 2007 :: Loading commands...
Wed Jun 27 17:32:07 2007 :: Loading spec_funs...
Wed Jun 27 17:32:07 2007 :: Loading sysdata configuration...
Wed Jun 27 17:32:07 2007 :: Loading socials
Wed Jun 27 17:32:07 2007 :: Loading skill table
Wed Jun 27 17:32:07 2007 :: Sorting skill table...
Wed Jun 27 17:32:07 2007 :: Remapping slots to sns
Wed Jun 27 17:32:07 2007 :: Loading classes
Wed Jun 27 17:32:07 2007 :: Loading races
Wed Jun 27 17:32:07 2007 :: Loading news data
Wed Jun 27 17:32:07 2007 :: [*****] BUG: load_news(): # not found (ÿ)
Wed Jun 27 17:32:07 2007 :: Loading herb table
Wed Jun 27 17:32:07 2007 :: Loading tongues
Wed Jun 27 17:32:07 2007 :: Making wizlist
Wed Jun 27 17:32:07 2007 :: Initializing random number generator
Wed Jun 27 17:32:07 2007 :: Setting time and weather
Wed Jun 27 17:32:07 2007 :: Loading DNS cache...
Wed Jun 27 17:32:07 2007 :: Assigning gsn's
Wed Jun 27 17:32:07 2007 :: Reading in area files...
(help.are)
gods.are      : Rooms:  1200 - 1201  Objs:  1200 - 1200  Mobs:  1200 - 1200
limbo.are     : Rooms:     2 - 99    Objs:     2 - 99    Mobs:     1 - 99
newacad.are   : Rooms: 10300 - 10499 Objs: 10300 - 10499 Mobs: 10300 - 10499
newgate.are   : Rooms:   100 - 199   Objs:   100 - 199   Mobs:   100 - 199
newdark.are   : Rooms: 21000 - 21499 Objs: 21000 - 21435 Mobs: 21000 - 21499
haon.are      : Rooms:  6000 - 6156  Objs:  6000 - 6155  Mobs:  6000 - 6117
midennir.are  : Rooms:  3500 - 3590  Objs:  3500 - 3550  Mobs:  3500 - 3550
sewer.are     : Rooms:  7001 - 7445  Objs:  7190 - 7310  Mobs:  7000 - 7206
redferne.are  : Rooms:  7900 - 7918  Objs:  7909 - 7911  Mobs:  7900 - 7900
grove.are     : Rooms:  8901 - 8999  Objs:  8900 - 8919  Mobs:  8900 - 8911
dwarven.are   : Rooms:  6500 - 6554  Objs:  6502 - 6519  Mobs:  6500 - 6517
daycare.are   : Rooms:  6601 - 6651  Objs:  6600 - 6647  Mobs:  6600 - 6610
grave.are     : Rooms:  3600 - 3651  Objs:  3600 - 3613  Mobs:  3600 - 3605
chapel.are    : Rooms:  3405 - 3475  Objs:  3400 - 3430  Mobs:  3400 - 3416
astral.are    : Rooms:   800 - 899   Objs:   800 - 899   Mobs:   800 - 899
Build.are     : Rooms:  9500 - 9589  Objs:     0 - 0     Mobs:     0 - 0
pixie.are     : Rooms:  2070 - 2099  Objs:  2070 - 2077  Mobs:  2070 - 2073
export.are    : Rooms:  9810 - 9899  Objs:  9810 - 9899  Mobs:  9800 - 9899
srefuge.are   : Rooms:  1500 - 1599  Objs:  1500 - 1599  Mobs:  1500 - 1599
manor.are     : Rooms:  2400 - 2499  Objs:  2400 - 2499  Mobs:  2405 - 2484
unholy.are    : Rooms:  2101 - 2172  Objs:  2101 - 2150  Mobs:  2101 - 2120
gallery.are   : Rooms: 24800 - 24899 Objs: 24800 - 24899 Mobs: 24800 - 24899
Wed Jun 27 17:32:07 2007 :: Fixing exits
Wed Jun 27 17:32:07 2007 :: Initializing economy
Wed Jun 27 17:32:07 2007 :: Resetting areas
Wed Jun 27 17:32:07 2007 :: Loading buildlist
Wed Jun 27 17:32:07 2007 :: ../gods/Argyle
Wed Jun 27 17:32:07 2007 :: ../gods/Findecano
Wed Jun 27 17:32:07 2007 :: Loading boards
Wed Jun 27 17:32:07 2007 :: ../boards/immortal.brd
Wed Jun 27 17:32:07 2007 :: ../boards/highgod.brd
Wed Jun 27 17:32:07 2007 :: Loading clans
Wed Jun 27 17:32:07 2007 :: Loading clans...
Wed Jun 27 17:32:07 2007 :: vampire.gui
Wed Jun 27 17:32:07 2007 :: Cannot open clan vault
Wed Jun 27 17:32:07 2007 :: druid.gui
Wed Jun 27 17:32:07 2007 :: Cannot open clan vault
Wed Jun 27 17:32:07 2007 :: warrior.gui
Wed Jun 27 17:32:07 2007 :: Cannot open clan vault
Wed Jun 27 17:32:07 2007 :: augurer.gui
Wed Jun 27 17:32:07 2007 :: Cannot open clan vault
Wed Jun 27 17:32:07 2007 :: thief.gui
Wed Jun 27 17:32:07 2007 :: Cannot open clan vault
Wed Jun 27 17:32:07 2007 :: cleric.gui
Wed Jun 27 17:32:07 2007 :: Cannot open clan vault
Wed Jun 27 17:32:07 2007 :: mage.gui
Wed Jun 27 17:32:07 2007 :: Cannot open clan vault
Wed Jun 27 17:32:07 2007 :: ranger.gui
Wed Jun 27 17:32:07 2007 :: Cannot open clan vault
Wed Jun 27 17:32:07 2007 :: $
Wed Jun 27 17:32:07 2007 ::  Done clans
Wed Jun 27 17:32:07 2007 :: Loading councils
Wed Jun 27 17:32:07 2007 :: Loading councils...
Wed Jun 27 17:32:07 2007 :: $
Wed Jun 27 17:32:07 2007 ::  Done councils
Wed Jun 27 17:32:07 2007 :: Loading deities
Wed Jun 27 17:32:07 2007 :: Loading deities...
Wed Jun 27 17:32:07 2007 :: $
Wed Jun 27 17:32:07 2007 ::  Done deities
Wed Jun 27 17:32:07 2007 :: Loading watches
Wed Jun 27 17:32:07 2007 :: Loading bans
Wed Jun 27 17:32:07 2007 :: Done.
Wed Jun 27 17:32:07 2007 :: Loading reserved names
Wed Jun 27 17:32:07 2007 :: Loading corpses
Wed Jun 27 17:32:07 2007 :: Loading Immortal Hosts
Wed Jun 27 17:32:07 2007 :: Done.
Wed Jun 27 17:32:07 2007 :: Loading Projects
*** glibc detected *** double free or corruption (!prev): 0x098411e8 ***

Program received signal SIGABRT, Aborted.
0x001697a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2


im guessing something to do with projects?
USA #25
Do you have a backtrace now?
United Kingdom #26
#0 0x001697a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1 0x001a97a5 in raise () from /lib/tls/libc.so.6
#2 0x001ab209 in abort () from /lib/tls/libc.so.6
#3 0x001dd71a in __libc_message () from /lib/tls/libc.so.6
#4 0x001e3fbf in _int_free () from /lib/tls/libc.so.6
#5 0x001e433a in free () from /lib/tls/libc.so.6
#6 0x001d4746 in fclose@@GLIBC_2.1 () from /lib/tls/libc.so.6
#7 0x0810473b in load_projects () at db.c:6929
#8 0x080f4ea4 in boot_db (fCopyOver=0 '\0') at db.c:704
#9 0x080e9ed2 in main (argc=1, argv=0xbfefccd4) at comm.c:533
(gdb)
USA #27
Okay. Try commenting out the call to load_projects in db.c, compile and boot again.
United Kingdom #28
::twitch::

Load_projects... caused that?
hmmm...

thanks for the help guys, its all sorted now =)
I'll take a look at projects i guess, though its nothing of to much importance i guess.

Thanks again =)
USA #29
Is it fine now? What does your projects.dat file (or whatever it is) look like? Perhaps that was corrupt. Because I've run Smaug 1.8 and it doesn't have this issue.
United Kingdom #30
It's not smaug1.8, it was smaugFUSS 1.7 however since i've commented that out it seems to work fine..

Project seems to also work fine, which is extremely strange to me. So to conclude... I aint got a foggest why it was causing the problem. Sorry.