Problem rebooting

Posted by Straud on Fri 22 Jun 2001 05:01 PM — 15 posts, 55,039 views.

#0
Everytime I type in the reboot mud now command it shuts down but doesn't reboot after 60 seconds like it is supposed to according to the help files
Australia Forum Administrator #1
That is because they run smaug from a shell script that loops, re-executing it each time.

You need to do something similar to achieve the same result.
#2
How would I go about doing that???
Australia Forum Administrator #3
There is a shell script in the "src" directory. I found this worked:


tcsh startup


This was using Cygwin. After the mud reboots it waits 15 seconds and starts it up again.
#4
the version I downloaded didn't have a src directory I don't see the shell script your talking about
Australia Forum Administrator #5

The one I am talking about was the download from ftp://ftpgame.org

If you downloaded from my site you could make a simple batch file like this:

:a
smaug.exe
goto a

I also wrote a utility for these situations, check out this: http://www.gammon.com.au/utilities/porttester.htm

Amended on Tue 20 Nov 2007 04:23 AM by Nick Gammon
#6
I made the batch file as you said and it will run the server but when you reboot it says C:\smaug1.4a\smaug>goto C
label not found
Australia Forum Administrator #7
I haven't written DOS batch files for a while - that was supposed to be a guide. I had the label the wrong way around, it is:

:a

not

a:

I have amended my earlier post to reflect that. Try that.
#8
okay that worked but the only problem with that is I can't use the shutdown command it will reboot also how can i put a time delay into this to make sure that old connections die
Amended on Tue 03 Jul 2001 10:37 PM by Straud
Australia Forum Administrator #9
You have two problems, one is how to make the loop wait, and the other to detect a shutdown.

The server writes out a file "shutdown.txt" if you do a shutdown, which you need to detect in the batch file.

Also, I couldn't find a program that would wait (although no doubt there are dozens) so I wrote a quick one. You can download the wait.exe program and source for it from here:


ftp://ftp.gammon.com.au/utils/wait.zip


Put the wait.exe file in the same directory as smaug.exe and then change your batch file to look like this:


if EXIST area/shutdown.txt DEL shutdown.txt

:loop
smaug.exe
if EXIST area/shutdown.txt goto end
wait 15
goto loop

:end
DEL area/shutdown.txt

Amended on Wed 04 Jul 2001 09:01 PM by Nick Gammon
#10
I can't connect to your ftp site says there is a network error preventing me
Australia Forum Administrator #11
The folder should have been "utils" not "utilities". I have corrected the above post, try again.
#12
I downloaded it and made the change to the bat file but it still reboots on a shutdown
Australia Forum Administrator #13
A little depends on where you have your batch file, in relation fo the "shutdown.txt" file.

You'll need to check that the location of the shutdown.txt file is where the batch file expects it to be. It might be best to put in the full pathname.

ie. Do a shutdown, work out what directory the shutdown.txt file is in, and put that exact path into the batch file.

eg. if "shutdown.txt" is in c:\smaug\area\shutdown.txt

then make the batch file read:


if EXIST c:\smaug\area\shutdown.txt goto end
USA #14
Okay. I have tried this and it seemed to work once I fiddled with the batch file and changed the '/' into '\' and did the correct paths since mine wants to put the logs in the src file.

It worked just fine once or twice but then seemed to not be making a shutdown.txt file anymore.

This is my batch file.



if EXIST c:\smaug\dist\src\shutdown.txt DEL shutdown.txt

:loop
smaug.exe
wait 15
if EXIST c:\smaug\dist\src\shutdown.txt goto end
goto loop

:end
DEL c:\smaug\dist\src\shutdown.txt



I have the batch file and wait in my area folder with my smaug.exe and my shutdown.txt was going into src file before but now there just isn't one at all. And the batch file restarts the mud so it isn't finding a shutdown.txt at all.

Thanks for any help,

Creep