Reboot problem: Mud goes down but doesnt come up

Posted by Arathelle on Mon 23 Jan 2006 08:18 PM — 54 posts, 178,099 views.

#0
I am having a problem with rebooting my Smaug MUD. It is ona linux shell, and everytime I reboot or there is the daily auto reboot, the mud goes down but never reboots itself. I've searched and searched and it doesn't seem to be a problem with the port I have the game set to, also I have the "fix" for the autoreboot. Can someone please help me out?
USA #1
Use nohup:
nohup ./startup &
#2
Thank you for the reply.

I regret to say that's what I use to start the mud everyday..

I also have to start it from the area folder. The mud boots, but when I use the reboot command or daily reboot occurs it doesn't come up on it's own.
USA #3
You shouldn't be booting it from the area dir. The startup script should be in and run from the src dir. Why are you running it in area?
#4
The codebase I am running requires me to start it from the area file. I use this:

nohup ../src/dbsaga 4000 &

If I start it from the src with the way you told me, I get permission denied. I also tried using this from the src folder:

nohup ./dbsaga &

Though it didn't do anything. There wasn't even a process that was started..
USA #5
You need to run the startup script. The exec will not 'reboot' because there is no script to do that.
#6
Each time I try to use the startup script, it tells me:

nohup: appending output to `nohup.out'
nohup: cannot run command `./startup': Permission denied
[1]+ Exit 126 nohup ./startup

I assume this is a problem with the chmod settings? What would be the proper way to correct this?
#7
OK. Changed the chmod properties to 755.

Now it gives me this:

nohup ./startup &
[1] 8252
nohup: appending output to `nohup.out'
[1]+ Exit 1 nohup ./startup
USA #8
Sometimes the startup script doesn't work. On SMAUG, it was made for Cshell, and like for me I run bash, and the commands don't cross over.
USA #9
Maybe check the nohup.out file?
#10
When I use the nohup command (nohup ./startup &) to start the mud up using the startup script this is generated in the nohup.out file:

Usage: csh [ -bcdefilmnqstvVxX ] [ argument ... ].

Using it with "nohup ./dbsaga &" works. Though only when executed in the area folder. Even using the other method with startup in the area folder does not work.


USA #11
Looks like it's using csh wrong. Can you paste the line in the startup script that has csh? Should be the first line or so.
USA #12
If he's using the standard DBSC 2.5 codebase, his first line of startup should be:
Quote:

#!/bin/csh -f


Now, I'm no shell expert, but when I looked at the same first line from SmaugFUSS, it was:
Quote:

#! /bin/csh -f


Noting the extra space after the ! mark. Perhaps that is enough to throw it off?
#13
Alas.. Samsom is right about how the startup script looks, though unfortunately the propsed fix did not work. Would pasting the entire startup script help you guys find the problem? I'm totaly clueless at this point.
USA #14
What are you using? Cygwin? Linux?
#15
Linux.
USA #16
I'm no shell expert either, but the DBSC startup script runs fine when I try it.

Can you give me a link to the version you're using? I'll try it out again.
#17
I'm using DBSC2.5. It can be found on www.dbsdevelop.com.

Are you starting the mud the way you told me to do it? If so, are you able to paste/email your startup file to me? Maybe there's something wrong with mine..
USA #18
Seems like it wants me to register? Is there any place I can get it without having to? I'm using links on my linux machine.
#19
I'm sorry.. None that I know of :(
USA #20
Why not ask on their forums?

Anyways, I'm compiling it now. I'll let you know in a sec.
[EDIT] Done. Starts up fine. No problems with csh. It's probably your host. This is the line in my startup:
#!/bin/csh -f
Amended on Tue 24 Jan 2006 04:22 AM by Zeno
#21
Does it reboot successfuly though? Thats the problem I'm having and it's really getting on my nerves >< Nothing's working.. If it works for you then I guess I will contact my host.
USA #22
I can't tell. There is no pre-set Immortal character I can login to?
Australia Forum Administrator #23
First, I would get startup to work without the nohup bit, eg.


./startup


If that doesn't work, then doing 'nohup ./startup &' won't work any better.

You could try showing the nohup.out file, eg.


cat nohup.out


However doing my first suggestion will achieve the same thing.

There may be a message about no "limit" command or something like that.

If that doesn't help, edit the startup file and put debugging points in, like this:


echo Doing CD

# Change to area directory.
cd ../area

echo Setting limits

# Set limits.
limit coredumpsize unlimited
limit stacksize unlimited

echo Removing shutdown file

if ( -e shutdown.txt ) rm -f shutdown.txt

echo And so on ...



Then when you test the file see how far in it gets.
Amended on Tue 24 Jan 2006 07:52 PM by Nick Gammon
USA #24
Assuming it's just stock DBSC 2.5 and the version is still current, you can find it here: http://www.mudmagic.com/codes/server-snippet/1958

As for the startup script fix I posted, I was grasping. It would probably help some to see your entire script.
#25
I am having a problem as well. It shuts down, but I need it to autoreboot itself. I am running a windows box.
USA #26
What have you tried to fix it?
#27
Well, I have tried to track down where it might have the reboot prompts, but, as I am new to this, I came up empty-handed.
USA #28
There are plenty of things in this thread that explain how to fix it. Did you try any of those?
#29
Well, I am trying to locate the files that these snippets and so on belong to. I am no C++ coder, I primarily do HTML heh
USA #30
What snippets? I don't think any snippets were mentioned in this thread.
#31
Well, I was referring to the pieces of programming that people were suggesting as insertions or replacements.
USA #32
All source files are in src. What exactly are you having trouble finding?
#33
Well, I need to know how to get the mud to reboot itself upon a shutdown.
USA #34
A shutdown? Or a reboot?
#35
A reboot. When I reboot the mud right now, it shuts it down, just as if I had typed: shutdown mud now

But I am typing: reboot mud now
USA #36
How are you starting the MUD up?

You should be running the startup script using nohup, as mentioned here earlier.
Amended on Thu 12 Apr 2007 12:53 AM by Zeno
#37
Yes, I am running it from the startup file.
USA #38
And you used nohup?
#39
THat is what I am asking, in which file, do I need to place the nohup? I am no coder as far as smaug goes.
USA #40
Why would using nohup matter? I mean, yes, it's meant to "run a command immune to hangups, with output to a non-tty" but that really shouldn't make a difference if he's using cygwin or still logged in to his shell as long as he's running the startup script and using the reboot command rather than the shutdown command. What seems more likely to me would be that his startup script is not getting the right exit level for the reboot so it's just doing a shutdown instead or that the startup script itself is broken, of course in the three pages so far, I think both of those have already been checked... but I'm really not feeling like going back and reading them all to make sure of it. If they haven't yet, those would be where I'd start looking. *shrug*

In the startup script, this is what I have for the restart section (at the very bottom of the script):
if ( -e shutdown.txt ) then
rm -f shutdown.txt
exit 0
endif
sleep 15

as for what else you need to check on for do_reboot and the other functions involved in a reboot, well.. there's quite a bit spread among a bunch of files that could stand to be checked.
USA #41
If you're going to use nohup, it goes in the command line, not a file, instead of starting the mud up by "cd src" then "./startup" (or "./startup &", you'd still "cd src" then do "nohup ./startup &"
#42
Ok, the way I am booting the mud, is I am going into the folder, and clicking on the "Smaug.exe" file. So, I have absolutely no idea what all that is Conner lol.
Australia Forum Administrator #43
If you double-click smaug.exe you are running a program. When it ends, it ends.

Zeno has already said "You should be running the startup script using nohup, as mentioned here earlier.".

That script has a loop in it, it starts smaug.exe, and when it stops (eg. on a shutdown), it loops around and starts it again. You need to use that.
USA #44
Had a feeling that might eb the case, so you're not running nohup or the startup script because you're in windows and not even using cygwin, no wonder it's shutting down instead of restarting. ;)

If you instead double click on the file startup (might be startup.bat?) it should solve the problem for you.
#45
Ok, I will see if I can find that, should I download cygwin to use for windows? I have XP Home.
Australia Forum Administrator #46
Yes, that is a Unix shell script. Install Cygwin and you will be better off, plus you can make changes (by compiling).

You might want to read this post - it might clear some things up:

http://www.gammon.com.au/smaug/howtocompile.htm
USA #47
Well, there's several schools of thought on that around here, a few folk would tell you that there are far better tools than cygwin, but if you're as new to this as you sound, yes, cygwin is probably your best bet until you're more comfortable with the unix setting's feel.
USA #48
Wow, quick response there Nick, and summed up better than I managed to do too. *L*
#49
Ok, thank you guys so much. I will read through that and download cygwin. If something is beyond me, then I will cry for help again heheh.
#50
Ok, where can I download cygwin? *Hides*
USA #51
No problem, we're here if you need us, as well as at http://www.fussproject.org/ too (which can be a really good resource as well). :)

As for finding cygwin, I'd start at http://www.cygwin.com/ myself. ;)
#52
Yeah, I found cygwin, and it is downloading like EVERYTHING now, so I forsee some waiting in my very near future :P. Actually, I am doing that now.
#53
Holy of holies.... I just read that compile page, and I feel a lot smarter now... Thanks for pointing that out.