[Freeciv-Dev] Re: Ctrl-D in server (PR#936)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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.
---
Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa
|
|