[Tutor] where to put configuration files

Kirk Bailey idiot1@netzero.net
Mon Jun 9 12:18:02 2003


nonono! I am wide awake! :-)

The nice thing about all in one place is not only is it simple, it can be very easy to 
understand. In my sist server software, I only went with the idea of a /lists directory 
to help with understanding- tossing EVERYTHING in the web cgi-bin makes for a LOT of 
irrelevant files to wade through when doing manual maintence; you don't want to see a 
web cgi-bin with EVERYTHING in there? At least this way it's organized, only list 
related files are in the directory!  But the program has to find the configuration file 
before it finds the configeration file, and the simplest solution is he default of 
'right here with me'. ANY OTHER PLACE may or may not exist, but if the SCRIPT exists, 
the .cf file exists. RIGHT HERE (wherever THAT is). It's just POLITICALLY INCORRECT.

I also considered a more complex directory tree system with standard file names for each 
item needed, and a directory per list. To access a list's files, just change current 
directories, then run everything that way referring to the desired files. Alas, I was 
new to python, and that left me somewhat confused. I may yet adopt such scheme in a 
future edition. Although  it is a more complex directory tree, the file naming scheme is 
simpler, and standardized- which may make execution faster, as it does not need to build 
up file names for each access.


Sean 'Shaleh' Perry wrote:
>>>If you *EVER* intend this to be real software used by real users, yes
>>>/etc is the place to go.  It is probably a good idea to create a subdir
>>>and place the config in there.  Something like /etc/mypackage/foo.conf.
>>
>>R. Alan Monroe wrote me off this mailing list and pointed out that
>>Windows users have no /etc/ directory. Mac OS X users do.
>>
>
Well, I knew this was true of MS-DOS, and in my WINSLOW98 Pieceo'Crap desktop there is 
no /etc, but in it creating a new dir is easy. In a windows SERVER? hmmm...

> 
> since you referred to /etc I assumed (yes I know ...) you were only referring 
> to a Unix like operating system.

Yep. I am waiting to hear that Linux is as dependable and secure as my trusted FreeBSD,
but WITHER is VASTLY preferable to the enslavement goods of the dread lord of Redmond...

> 
> If you truly want to be portable here we go .....
ohboyohboyohboy...

> 
> a) easy case, store all of the program in one base dir as suggested.  Expected 
> behavior on Windows and I believe OS X.

okfine. UM, we put the list's files in with the scripts?!?

> 
> b) however, this is the WRONG behavior under a Unix like OS.  /usr is often 
> mounted read-only so your config once written could never be changed.

HMMMM....
> It 
> also prevents people from packaging the software and integrating it with the 
> rest of the OS (say for instance Debian, RedHat, NetBSD).
> 
> Therefore as Kirk mentions the best situation is to have the location of th 
> config defined as a variable and allow the installation procedure to indicate 
> where the config ends up.
>
Ah, BUT:
how does it find it?
To find it, one must tell it where it is.
To do this with a config file is a bootstrap problem.
To do this by hacking the script is a complexity issue for less than totally savvy 
installers.

To do this  by asuming it is RIGHT HERE WITH ME is a solution that is simple, reliable, 
and offers no additional burden to the novice.

It's just politically incorrect.

> Note this same discussion is relevant for logs, data and just about anything 
> else you write.
> 
> ** for the purists out there, let me settle the pedantic issues screaming in 
> your head.
> 
> Yes, old school Unix used to dump a program in /usr/lib/app.  As noted above 
> this prevents /usr being mounted read-only and also prevents proper 
> utilization of things like network mounted directories.  A modern approach to 
> this is to have a /opt hierarchy and each directory in /opt is like a 
> installation directory in OS X or Windows.  Just drop the whole thing there 
> and everything works.  However not everyone likes /opt or supports it fully 
> (the Linux Standards Base will slowly get the Linux community to support it 
> though).
> 
> If you like the all in one place philosophy or the spread out philosophy the 
> above suggestion allows for either.
> 
> Now that I have put everyone to sleep, back to your regularly scheduled 
> emails.


> 
> 
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
> 
> 


-- 

end

Cheers!
         Kirk D Bailey
                               think
http://www.howlermonkey.net/ +-----+ http://www.tinylist.org/
http://www.listville.net/    | BOX | http://www.sacredelectron.org/
                              +-----+
"Thou art free"-ERIS          think    'Got a light?'-Promethieus

.