06-27-2002, 11:47 PM | #1 |
New Member
|
we've been having some problems with crashes at the mud i code for. sometimes it will crash and the parent process dies too (a startup script running on a loop). when this happens the mud is down for hours at a time, since only two people can get to the server. we have a copy of the game running on another port, completely independant of the main one, and its up all the time.
until we get all these bugs under control, i was thinking of writing a command for the test port that would run the startup script for the main port (so staff members can start the main game up with out going to the server), but i don't know of a way to do this. any suggestions? |
06-28-2002, 01:15 AM | #2 |
Member
Join Date: Apr 2002
Posts: 122
|
Codebase? Dev platform? Host OS?
|
06-30-2002, 02:19 PM | #3 |
New Member
|
its a rom mud on a server running redhat 7.2
|
07-19-2002, 10:50 PM | #4 |
New Member
|
Um... Trying to think. Basically, just write a command (startmain) or something, and have it execute a system call. The sytanx would be system("command"); so, depending, somthing like:
[code] void do_startmain(char *argument, CHAR_DATA *ch) { if(!IS_IMMORTAL(ch)) return; system("./../area/startup 3345") return; } [/quote] This hasn't been bug-tested, but that's the general assumption, assuming you're running them off the exact same code. If you're not, and especially if they're run off different accounts, then that's more about Linux than I know. But essentially make the system call to wherever the startup script is. But I'm curious, are the two sets of code the same? Same account, same privledges, etc? |
07-20-2002, 09:34 PM | #5 |
Member
|
I strongly recommend doing more than just a system call. At the very least, check against the game running already, and if it is abort the command. You could do even better by adding this to the startup script. Take it one step further and add a panic-exit to the script if logfile > 1000 increments. A very large number of admins out there will end up starting 2 or more processes of the startup script, and then kill them hours or days later (or the sysadmins will), but there are > 10000 logfiles created by that time, which must be iterated through in the startup process.... bah
Check for the game running, and save yourself and others some heartache later. |
07-21-2002, 08:44 AM | #6 |
Member
Join Date: Apr 2002
Posts: 122
|
The simplist approach I can think of would bypass system calls completely. Just do message passing through a file. It's sort of a kludge, but it gets the job done.
All you need is a perl script running in the background that continually checks for the existance of a certain file. If the file exists, the script executes whatever checks are necessary to ensure that it's a valid boot attempt, calls the boot script., and then deletes the file. The command to reboot the MUD from the test port would simply create the file that the script checks for. This will work even if your test MUD is on a different account, as long as the script is running with the proper permissions. edit: Regarding security, this solution is very good. The test mirror account doesn't need to have write,exec, or even read permission on the live account. |
system calls - Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Account System Yay or Nay | darmir | Advanced MUD Concepts | 15 | 04-26-2006 10:04 PM |
Stats System | darmir | Advanced MUD Concepts | 14 | 03-10-2006 05:17 PM |
New Library System in Achaea! | Maya | Advertising for Players | 0 | 07-05-2005 01:39 AM |
Crafting system | KaVir | Advanced MUD Concepts | 22 | 04-15-2005 03:39 AM |
Combat system | Blade | MUD Coding | 3 | 11-07-2003 08:03 PM |
|
|