Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2001:
[Freeciv-Dev] Re: Patch for civserver: save game on SIGPWR, SIGTERM or S
Home

[Freeciv-Dev] Re: Patch for civserver: save game on SIGPWR, SIGTERM or S

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Eric R. Smith" <ersmith@xxxxxxxxxxxxxx>
Cc: <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Patch for civserver: save game on SIGPWR, SIGTERM or SIGHUP
From: Mika Korhonen <mikak@xxxxxxxxxxxx>
Date: Fri, 4 May 2001 08:05:48 +0300 (EEST)

On Thu, 3 May 2001, Eric R. Smith wrote:

>Attached is a small patch to provide "emergency" saves when certain
>signals (like SIGPWR) are received. This means that when your
>fancy UPS notices that the power is down, it can shut down the
>civserver without any moves or data being lost. It also provides
>a way to "gracefully" shut down the server if you can't get
>access to the console but can log in remotely -- just send it a
>SIGTERM or SIGHUP signal. (Before, doing this just killed the
>game with no save file being created.)

Almost zero-probability pitholes:

1) what if SIGxxx is caught in the middle of saving the game
2) what if signals, say SIGHUP and SIGTERM, arrive in (very
   close) succession

Well these are extremely rare cases and I vote for these nice patch even
without addressing those cases (for this will save 99 games that otherwise
would get lost at lose at most 1 game that otherwise would get saved ;-).

        Mika
_______________________________________________________________________________
I just asked myself... what would John DeLorean do?
                -- Raoul Duke



[Prev in Thread] Current Thread [Next in Thread]