Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2001:
[Freeciv-Dev] Re: Ctrl-D in server (PR#936)
Home

[Freeciv-Dev] Re: Ctrl-D in server (PR#936)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Vasco Alexandre Da Silva Costa <vasc@xxxxxxxxxxxxxx>
Cc: Paul Zastoupil <paulz@xxxxxxxxxxxx>, Christian Knoke <ChrisK@xxxxxxxx>, freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Ctrl-D in server (PR#936)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 5 Sep 2001 08:42:24 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Wed, Sep 05, 2001 at 12:06:07AM +0100, Vasco Alexandre Da Silva Costa wrote:
> On Tue, 4 Sep 2001, Raimar Falke wrote:
> 
> > On Tue, Sep 04, 2001 at 11:02:47AM -0700, Paul Zastoupil wrote:
> > > On Tue, Sep 04, 2001 at 11:02:03AM -0700, Christian Knoke wrote:
> > > > CVS 03 SEP 2001 i386 Linux w/ readline support
> > > > 
> > > > When you type Ctrl-D in the server, you get:
> > > > 
> > > > 2: Server cannot read standard input. Ignoring input.
> > > > > 
> > > > 
> > > > If you type it a second time, the input is blocked.
> > > > You cannot issue any server commands then.
> > > 
> > > I think this is a feature rather than a bug. 
> > 
> > > Didn't it previously exit the server if you did a CTRL-D?
> > 
> > AFAIK yes. This is the way unix programs work.
> 
> I made a patch once that made it work "the UNIX way", but we run civserver
> in civserver.freeciv.org inside shell scripts kind of like this:
> 
> civserver < /dev/null > logfile 2>&1
> 
> If civserver works "the UNIX way" it will simply exit. If we don't ignore
> stdin the server can hangup. So closing stdin is a good option.
> 
> Civserver on civserver.freeciv.org is more of a UNIX daemon than a UNIX
> utility. UNIX daemons close stdin and redirect stdout & stderr to a
> logfile - this is basically what we are doing.

This is another reason to think about a PUBLIC_SERVER define or a
"--demonize" command line option.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "The very concept of PNP is a lovely dream that simply does not translate to
  reality. The confusion of manually doing stuff is nothing compared to the
  confusion of computers trying to do stuff and getting it wrong, which they
  gleefully do with great enthusiasm." 
    -- Jinx Tigr in the SDM


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