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.
 Entire forum ➜ Programming ➜ General ➜ Another fairly hard topic.. Copyover

Another fairly hard topic.. Copyover

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


Posted by Trom   (82 posts)  Bio
Date Tue 31 May 2005 05:16 PM (UTC)

Amended on Tue 31 May 2005 05:17 PM (UTC) by Trom

Message
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).
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #1 on Tue 31 May 2005 10:32 PM (UTC)
Message
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.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Trom   (82 posts)  Bio
Date Reply #2 on Tue 31 May 2005 11:24 PM (UTC)

Amended on Tue 31 May 2005 11:25 PM (UTC) by Trom

Message
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 ;)
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #3 on Wed 01 Jun 2005 08:14 AM (UTC)
Message
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.

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

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #4 on Wed 01 Jun 2005 08:56 AM (UTC)
Message
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)?

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Raz   (32 posts)  Bio
Date Reply #5 on Mon 06 Jun 2005 03:42 PM (UTC)
Message
Quote:
execl ( EXE_FILE, "copyover", NULL );


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

-Raz
C++ Wiki: http://danday.homelinux.org/dan/cppwiki/index.php
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.


23,783 views.

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.