Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2000:
[Freeciv-Dev] Re: Idea: server autoread config files
Home

[Freeciv-Dev] Re: Idea: server autoread config files

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Piotr Sulecki <Piotr.Sulecki@xxxxxxxxxxxxx>
Cc: FreeCiv Development <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Idea: server autoread config files
From: Marco Colombo <marco@xxxxxx>
Date: Tue, 29 Aug 2000 18:23:06 +0200 (CEST)

On Tue, 29 Aug 2000, Piotr Sulecki wrote:

> Ave!
> 
> > > What do you think about having a configuration file read automatically
> > > by civserver upon start?
> > 
> > That's what the -r option is for!
> 
> ... and you have to remember the file name to read, mention it in the
> scenario description, even type it all in at civserver start... Wouldn't
> it be simpler for civserver to check if a file exists, and if so, read
> it?

<lurker mode off>

I'm against duplication of features. What you're asking for can be
easily implemented by writing a small shell script, which in turn
uses the -r option. Or (a more private way) with a shell alias.
Really I don't see the need to write it in C and having it linked with
the server binary. No matter how complex you make it, there will always
someone whose needs are not covered by your schema. A shell script can
be a short as:

#! /bin/sh -
rcfile=${HOME}/.civserverrc
if [ -r $rcfile ]; then
        exec civserver -r $rcfile $*
else
        exec civserver $*
fi

or a 15KB script which checks tens of different paths depending on
external variables such as user/time...

I used to have one that did:
1) cd to a certain dir
2) move away all civgameNNNN.sav.gz files
3) run the server

<lurker mode on>

> > > I'm thinking of some file (perhaps .civserverrc) which is read from
> > > civserver's current directory, then (if it fails) from the home
> > > directory of the user starting it, or finally from freeciv install dir.
> > 
> > I once did a patch to implement this but I'm not sure it's a good
> > idea.  Unix apps suffer greatly from the 'where the hell did it get
> > *that* config again' problem and one way to solve it in this case is
> > not to read a config file by default at all.  civserver has problems
> > with locating its the rulesets already.
> 
> A simple solution: implement a --print-paths command line option in
> civserver.
> 
> What problems does civserver have with locating rulesets? Could you
> explain?
> 
> PeterS.
> 
> 
> 

.TM.
-- 
      ____/  ____/   /
     /      /       /                   Marco Colombo
    ___/  ___  /   /                  Technical Manager
   /          /   /                      ESI s.r.l.
 _____/ _____/  _/                     Colombo@xxxxxx




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