Startup script

Posted by Kuru on Mon 09 Aug 2004 04:56 AM — 17 posts, 62,130 views.

#0
I have a shell and all the files were transfered to it. Now I can't seem to startup the mud... none of the commands I've seen such as: .startup, ../src/smaug 4000 &, and tcsh startup. Could someone please help me? Heres the startup script if you need it.

#! /bin/csh -f

# Set the port number.
set port = 8132
if ( "$1" != "" ) set port="$1"

# Change to area directory.
cd ../area

# Set limits.
nohup
#limit stacksize 1024k
#limit coredumpsize 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 15
end
USA #1
Okay, but what we really need to know is the error you are getting.
#2
@frostmud:~$ .startup
-bash: .startup: command not found

@frostmud:~/area$ ../src/smaug 8132 &
[1] 10863
@frostmud:~/area$ -bash: ../src/smaug: No such file or directory

@frostmud:~/area$ tcsh startup
startup: No such file or directory.

Thats what I got.
Amended on Thu 26 Apr 2007 08:51 PM by Kuru
USA #3
Okay, are you in the corret directory? Type 'ls' to view the files in the current directory. Not sure if this makes a difference, but try:

./startup 8132 &
#4
@frostmud:~$ ./startup 8132 &
[1] 11003
-bash: ./startup: No such file or directory
[1]+ Exit 127 ./startup 8132

@frostmud:~/src$ ./startup 8132 &
[1] 11008
-bash: ./startup: Permission denied
[1]+ Exit 126 ./startup 8132

@frostmud:~/area$ ./startup 8132 &
[1] 11004
-bash: ./startup: No such file or directory
[1]+ Exit 127 ./startup 8132

Thats what I got.
USA #5
Ah, so you were in the wrong directory. Stay in the src directory, thats the correct one.

Nick has a guide to the startup script, it should answer your question:
http://www.gammon.com.au/smaug/howtocompile.htm#example

Try using tcsh.

If that doesn't work, then change the permissions with chmod.
#6
I read the guide and it really didn't help me :/ I did what you said about the directories and it still gave me the same problems. Now how exactly do I use the chmod command?
USA #7
Read the manual on chmod. I'm not sure what startup should originally be, as a permission.
#8
Hmmm seems I'm getting somewhere... I never compiled in the sever, only on my computer, but when I recompiled on the sever I got a new file...

@frostmud:~/src$ ls
Makefile clans.c hashstr.c magic.c reset.c
act_comm.c color.c hiscores.c makeobjs.c save.c
act_info.c color.h hotboot.c mapout.c services.c
act_move.c comm.c hotboot.h misc.c shops.c
act_obj.c comments.c i3.c mpxset.c shutdown.txt
act_wiz.c const.c i3.h mud.h skills.c
backup.c db.c i3cfg.h mud_comm.c smaug*
ban.c deity.c ident.c mud_prog.c smaug.exe
bet.h fight.c imc.c o/ special.c
board.c finger.c imc.h planes.c startup
board.h finger.h imccfg.h planes.h tables.c
boards.c grub.c imm_host.c player.c track.c
build.c handler.c interp.c polymorph.c update.c

There was a never a file named 'smaug*' before, then just for curiosity I typed smaug and it started to boot up, but it couldn't since there were no area files. Then I went into the area dir and type ../src/smaug and it started, except there were 2 problems: 1) It started at port 4000 and 2) When I close the PuTTY window the mud shuts down. So it seems I still haven't figured out the problem with the startup script. :/
USA #9
Well what you could do for now, until you fix the startup problem, is in the area directory, start smaug:

../src/smaug 8132 &


The ampersand allows the program to run while the user is off.


[EDIT] Actually, try copying all of what is in the startup file, and delete the startup, then create a new startup script, and paste the old startup text.
Amended on Mon 09 Aug 2004 06:26 AM by Zeno
#10
Ok I got the mud up and running, but I'm not really sure how I make a new startup scirpt... as in the format. So any help?
USA #11
Create a new file named 'startup' with any editor, like pico. Then copy the old startup script into the new one.
#12
Ok I created a new startup script with metapad but the file is 'startup.txt'. I don't think thats the right file extension its suppose to have...
USA #13
No its not, its not suppose to have any extension.
#14
Ok I think I have almost every thing working. The startup script starts the mud like its suppose too, but as I said earlier when I close the PuTTY window the mud shutsdown also. Is there any way to fix this?
USA #15
Yes, like I said before, use an ampersand.

./startup &
#16
I finally fixed it! It was the permision error that wouldn't let the mud stay, so now the mud starts up with the script. Thanks for all the help.