Another fairly hard topic.. Copyover

Posted by Trom on Tue 31 May 2005 05:16 PM — 6 posts, 32,145 views.

#0
I've been playing around with this code for a while now and without my c reference book its a bit hard to figure out. The situation is that copyover freezes, never reaches the copyover_recovery() which i'm guessing works, but never been able to see it in action. The do_copyover() function tries to pass more than 1 argument through execl() which causes the execution to stop running.

Changed this:
execl ( EXE_FILE, arg0, arg1, arg2, arg3, ( char * ) NULL );

To:
execl ( EXE_FILE, "copyover", NULL );

The change doesn't stop the program from running but it does run without copyover being recovered (which freezes the mud, players who connect remain on 'connected' but never see the mud intro screen or anything).

Did some checking and it seems execl() can only pass argv[0] to the main() handler, the mud itself. From what i've seen it has to pass "copyover" to argv[2] and various other values. Does anyone know how i can get copyover to work?

Using Heavily modified Rom2.4/Rot1.4 but unchanged in respect to copyover.. It seems to be very similar to erwins v7 copyover snippet (however i'm guessing this came with rot1.4 or something).
Amended on Tue 31 May 2005 05:17 PM by Trom
USA #1
You're running under cygwin? (I think all of these things belong in the ROM forum, from what I've seen, ROM2.4 and ROT1.4 are the same thing basically)

It seems that copyover in windows is hectic at best. This is because windows won't allow you to overwrite an exe while it's running.

Regardless, I can't seem to find a single reference to any copyover sort of thing in any of my source. Where did you get the snippet? I still don't think you'll be able to get a seamless copyover.
#2
http://www.mudsnippets.net/index.php?page=search&type=Administrative

Its all over the place the download, i originally got my codebase off some guys who were learning to code. So they probably were adding snippets, this being one of them. Too bad theres not a way to start a 2nd copy of the mud then transfer the users to it,then close the first copy.. In anycase the other imp of the mud runs it off her comp on windows and i compile/test in cygwin. I occassionally run it on a linux server which is much like cygwin.

If theres no way around this copyover in windows thing than thanks for the tip. I'll probably just remove the code so it stops causing trouble ;)
Amended on Tue 31 May 2005 11:25 PM by Trom
USA #3
Actually, there is but it requires rewriting the makefile and the copyover code to accomodate working with 2 diff files. I know there's at least 1 other thread that discusses just that idea for copyover under cygwin.
USA #4
Take your pick...
http://www.gammon.com.au/forum/bbsearch.php?searchfor=cygwin+copyover&bbsection_id=0&bbtopic_id=0&action=search

Couple (many) relevant ones. Some of which seem to indicate it might work (and address the issues of why it won't).

I'm still sort of stuck on the whole idea of switching a socket (connection) to another program, since that's what you're basically doing. Everything else is just code, and hacks. But that just doesn't sit well. Anyone care to explain how it happens (or how the connections allow this? or whatever makes it possible)?
#5
Quote:
execl ( EXE_FILE, "copyover", NULL );


Try casting NULL to a char * (hence, (char *)NULL)). That _should_ resolve your problem.