Re: Relocatable installs

From: Shachar Shemesh <psql(at)shemesh(dot)biz>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Relocatable installs
Date: 2004-05-09 04:54:46
Message-ID: 409DB996.2030506@shemesh.biz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian wrote:

>Shachar Shemesh wrote:
>
>
>>Bruce Momjian wrote:
>>
>>
>>
>>>Comments?
>>>
>>>
>>>
>>>
>>What's wrong with the way it's done by everybody else?
>>
>>Have hardcoded paths (determined at configure time), and allow override
>>using a config file. Have a command line option for saying where the
>>config file should be.
>>
>>
>
>Where do we put the config file so it can be found? We can't assume
>root privilege to write into /etc.
>
>
Put it in /etc (or wherever else user said in configure). Allow a
command line parameter that says "run the server with this config file
instead". User can place override config file wherever she damn wishes.

>>For Windows, replace config file with "Registry". That is usually
>>hardcoded for (depending on whether you want it changeable per-user)
>>HKEY_LOCAL_MACHINE\Software\<company name>\<product name> (replace HKLM
>>with HKEY_LOCAL_USER if you want per-user config).
>>
>>
>
>Doesn't registry require admin privilege on the Windows box?
>
>
HKLM does. HKCU doesn't. Actually, HKLM often doesn't either, but that's
a rant I won't start right now.

Again, you can use command-line arguments to override, if you want.
Alternatively, Postgres can look at HKCU, and if not found there, at
HKLM. This means that there can be a system-wide default, overrideable
per user by each user. The only reason I'm suggesting this (as it is
unlikely that for production installs more than one user will be running
postgres) is that editing user keys for other users is a task I'm not
sure many admins know how to do. It requires the use of the
not-well-known "regedt32" rather than "regedit", and involves loading
the correct file into the registry "hive". As such, placing stuff in
HKLM allows admins to easilly edit it. If that is not an issue, I'd say
"place it at HKCU".

Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting
http://www.lingnu.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc Slemko 2004-05-09 05:17:25 Re: Relocatable installs
Previous Message Bruce Momjian 2004-05-09 04:37:17 Re: Relocatable installs