Startup Script help

Posted by Cozzmolot on Sat 08 Jan 2005 07:56 AM — 10 posts, 41,022 views.

#0
Ok, I've spent a couple of days trying to figure this problem out myself, and it is just time ot turn to help. I am able to run my mud just fine using cheesy ways to get it to boot up .. i.e. ../src/rom 8445 etc. I need to use my startup script though so that I can restart and have log files etc.

Okay as of right now this is the errors I get when I boot up the mud the following ways:

cozzmolot@frostmud:~/QuickMUD/area$ ./startup &
[1] 8758
: bad interpreter: No such file or directory
[1]+ Exit 126 ./startup
cozzmolot@frostmud:~/QuickMUD/area$ startup &
[1] 8884
: bad interpreter: No such file or directory
[1]+ Exit 126 startup
cozzmolot@frostmud:~/QuickMUD/area$ ./startup 8445 &
[1] 8885
: bad interpreter: No such file or directory
[1]+ Exit 126 ./startup 8445
cozzmolot@frostmud:~/QuickMUD/area$ startup 8445 &
[1] 8886
: bad interpreter: No such file or directory
[1]+ Exit 126 startup 8445


and this is my script

#!/bin/tcsh
# Written by Furey.
# With additions from Tony and Alander.

# Set the port number.

set port = 8445
if ( "$1" != "" ) set port="$1"

# Change to area directory.
cd ../area

# Set limits.
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

# Run rom.
../src/rom $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

whats wrong here?
USA #1
First problem, I don't think the startup script is supposed to be in area.

Second problem, it would appear that you don't have tcsh installed. Are you running on your own local installation of Cygwin? If so, install the tcsh package. If not, contact your system administrator and ask them (politely, of course :P) to install tcsh.

Somewhere on this forum, there are cases of people who didn't have tcsh and had to translate the startup script to another scripting language; maybe you'll find something there. I don't remember if the solution was posted or not.
#2
no tcsh is installed. where else should it be put?
USA #3
Alright, you need to install tcsh, then. See my above post for how to do that; let me know if you have trouble. And you'll also have to specify what kind of server you have etc.

As for the startup script, I think it belongs in the src directory; at least, that's how SMAUG does it. I don't know if ROM does it differently. Did you put that there, or was it there in the default package?
Amended on Sat 08 Jan 2005 05:56 PM by David Haley
#4
Sorry for the misunderstanding but TCSH IS installed. I'll try moving the startup file into different directorys and see if that helps.
USA #5
Where was the startup script in the default package? That's where you'll want to put it.

What kind of system are you running? Where is tcsh installed? You'll have to make the first line of the startup script be the path to tcsh with a ! in front, e.g. !/bin/tcsh or !/usr/bin/tcsh or wherever tcsh is installed.
USA #6
Rom appears to put the startup in the area directory. I have several Rom bases unpacked and that's where the script is in all of them.

As for how to find where tcsh is installed, on the command prompt, type:

which tcsh

It will respond with a path to the file. This works on Cygwin and Linux.
#7
Please share how you setup your makefile for cygwin?
USA #8
One of the more obvious things to check (as a programmer) that doesn't usually get checked until dead last is the script call for the executable. I notice the script is calling ../src/rom but you're running under cygwin so the file you should probably be calling is ../src/rom.exe - this one tends to be a recurring villan of sorts in cygwin startup scripts.
USA #9
Quote:
this one tends to be a recurring villan of sorts in cygwin startup scripts.
I thought cygwin figured this out for you. I know that if I type 'babble' even though the exe is 'babble.exe', it works. Perhaps it doesn't work from inside scripts of the exec call, however, I don't believe I've tried it there.