Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ Running the server ➜ automatic shutdown?

automatic shutdown?

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1 2  

Posted by Flashattakjak   (20 posts)  Bio
Date Mon 05 Aug 2002 01:19 PM (UTC)
Message
I leave my server on at night, and when I wake up in the morning it's always shut down and gone.

Is there some where in the scripting files that tells the server to shut down after so long?
Top

Posted by Nick Gammon   Australia  (23,131 posts)  Bio   Forum Administrator
Date Reply #1 on Mon 05 Aug 2002 09:09 PM (UTC)
Message
It is designed to do that (at 6 am I think). if you run the shell script "startup" that reboots it for you. It does it to reclaim memory so the program doesn't gradually "bloat". If course, it shouldn't have to, but they probably thought that was easier than finding every memory leak.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Arsen   (44 posts)  Bio
Date Reply #2 on Sat 31 May 2003 05:08 AM (UTC)

Amended on Sat 31 May 2003 05:09 AM (UTC) by Arsen

Message
so how do I stop this from happening? I don't use the startup script so it must be hard coded somewhere, I tried staying on my mud to see what would happen and after I was connected for 3 days it started to give these messages, in this order:
-The aura of magic that surrounds the realms seems slightly unstable.
-The seas across the realm have turned frigid.
-You notice the life forms around you slowly dwindling away.
-The sky has suddenly turned midnight black.
-Crashes of thunder sound across the land!
-Lightning crackles in the sky above!
-You feel the ground shake as the end comes near!

and then:
You are forced from these realms by a strong magical presence as life here is reconstructed.
Log: Automatic Reboot

and the MUD is down....
Top

Posted by Boborak   USA  (228 posts)  Bio
Date Reply #3 on Sat 31 May 2003 11:15 AM (UTC)
Message
If you really wanted to stop this from happening, you could remove the check from the code. In db.c look for reboot_check() it should be in update_handler(). Either comment it out or remove it. I personally wouldn't reccommend doing it, because of how prone SMAUG is to memory leaks, but it could easily be done none the less.
Top

Posted by Arsen   (44 posts)  Bio
Date Reply #4 on Sat 31 May 2003 05:15 PM (UTC)
Message
what do you mean by "memory leak" what would really happen if it didnt reboot every night?
Top

Posted by Nick Gammon   Australia  (23,131 posts)  Bio   Forum Administrator
Date Reply #5 on Sun 01 Jun 2003 04:45 AM (UTC)
Message
The amount of memory used by SMAUG would gradually increase - by how much and how quickly you would need to see for yourself, it would probably depend on how many players were on and how active they were.

Eventually (after days, maybe weeks, maybe months) your PC would slow down as more and more of its memory was taken by SMAUG.

However if you are using Windows, it may well crash before that happens so no great harm done. :)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Garaelb   (54 posts)  Bio
Date Reply #6 on Thu 12 Jun 2003 05:02 PM (UTC)
Message
Does the shell script automatically reboot the game after an auto-shutdown?

At 6 Am I'm either dead to the world or driving to work (and still might be dead to the world LOL) so I would like to know on a windows machine how to make this process automatic.
Top

Posted by Garaelb   (54 posts)  Bio
Date Reply #7 on Thu 12 Jun 2003 05:12 PM (UTC)
Message
I should also note that I'm on a win98se system, and I have looked thru the dirs of Smaug and do not see a file labled autostart or anything of the sort. is there one?
Top

Posted by Nick Gammon   Australia  (23,131 posts)  Bio   Forum Administrator
Date Reply #8 on Thu 12 Jun 2003 09:36 PM (UTC)
Message
I doubt there is anything there custom-written for Windows 98. You could do a few things:


  • Recompile, taking out the shutdown
  • Set up some sort of timed event under Win98 (if there isn't one built-in look on the Internet for a simple utility) that starts it up at 6:05 am every day
  • There is a program in the utility section (I think) on this web site that checks if the MUD is down. You could run that in another window (a DOS window) so that it checks every few seconds and if the MUD is down, starts it up again.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Arsen   (44 posts)  Bio
Date Reply #9 on Sun 15 Jun 2003 04:38 AM (UTC)
Message
I just dont understand how shutting down can somehow save memory...
Top

Posted by Boborak   USA  (228 posts)  Bio
Date Reply #10 on Sun 15 Jun 2003 11:19 AM (UTC)
Message
It's quite simple really. Over time, bits and pieces of memory that Smaug allocates are not de-allocated as they should be. This is normally as small as a few bytes, usually from strings not being de-allocated properly. But gradually this "leaked" memory adds up. The more active your mud is, the faster this will happen and the more memory Smaug will be using that it doesn't need. It's been my experience, that stock Smaug will on average, increase it's RAM usage 1-5megs a day with minimal players. MS Windows is notorius for doing this same exact thing. Ever wonder why a reboot seems to fix so many issues in Windows?

Need more proof? Check the mud's memory usage right before it's scheduled reboot and then check it after the reboot and note the difference. It may be bigger then you think.

Final note. In today's age of computers with GIG's of RAM becoming commonplace.. a few megs here and there really doesn't make much of a difference. But ignoring the problem doesn't mean it'll go away. Memory leaks can cause other problems that may actually crash your mud over time. Rebooting periodically, keeps this to a minimum.
Top

Posted by Goblin   (39 posts)  Bio
Date Reply #11 on Tue 01 Jul 2003 12:37 AM (UTC)
Message
um ok well ive just done a scheduled task to run the smaug every 6:05am

that should do it :p
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #12 on Tue 01 Jul 2003 02:02 PM (UTC)
Message
Out of curiosity, is there a builtin command in Unix/Linux that gives you statistics on your program, like how much memory it is currently using, and the percentage of the processor? I'm sure there is one, but while I've become fairly proficient in navigating and editing files on Unix, the system commands sometimes remain elusive. :P I know that using ps will show me how much processor time a program has used, but I'm also interested in things like percentage.

Also, if my server is running on a system that gives memory quotes to users - not disk space, but RAM quotas - and the program reaches the quota... and then tries to allocate more memory, malloc will fail and might return NULL, right?


I don't know what OS you're on, but I think Windows 2000 also lets you start up a program only if it's stopped. So for your MUD, you might want it to check constantly - like every 10, 15 minutes - and restart the executable in case the game crashed or something. It's all in the Task Manager, if I remember correctly.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Nick Gammon   Australia  (23,131 posts)  Bio   Forum Administrator
Date Reply #13 on Tue 01 Jul 2003 09:02 PM (UTC)
Message
The quick answer is to type in "top" - this shows the top usage processes and various summaries.

As for RAM, yes it is always a possibility that malloc might return NULL, and with memory quotas I would say that is quite likely.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #14 on Tue 01 Jul 2003 10:20 PM (UTC)
Message
The task manager is capable of starting a new process in 2k as with all previous versions of windows. I use it to do a great many maintenance features that would otherwise be overlooked far too often so using it to restart SMAUG should work fine.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


64,375 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.