Re: BUG #4787: Hardlink (ln) causes startup failure with bizarre "timezone_abbreviations" error - Mailing list pgsql-bugs

From Mark
Subject Re: BUG #4787: Hardlink (ln) causes startup failure with bizarre "timezone_abbreviations" error
Date
Msg-id 200905020754.n427sc4d024319@asarian-host.net
Whole thread Raw
In response to Re: BUG #4787: Hardlink (ln) causes startup failure with bizarre "timezone_abbreviations" error  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #4787: Hardlink (ln) causes startup failure with bizarre "timezone_abbreviations" error
List pgsql-bugs
-----Original Message-----
From: pgsql-bugs-owner@postgresql.org
[mailto:pgsql-bugs-owner@postgresql.org] On Behalf Of Tom Lane
Sent: vrijdag 1 mei 2009 23:57
To: Mark; pgsql-bugs@postgresql.org
Subject: Re: [BUGS] BUG #4787: Hardlink (ln) causes startup failure with
bizarre "timezone_abbreviations" error

> What I'm inclined to do is modify PostmasterMain so that immediately
> after find_my_exec, it checks that get_share_path returns the name of
> a readable directory.

I understand the rationale for relocatable packages. So, I guess hardlinks
are out. But, barring hardlinks, perhaps, in the existence of a symlink, a
simple 'readlink' function could be done to auto-correct PostgreSQL's
base-location? Ala:

char buf[1024];
ssizet_t len;
....
if ((len = readlink ("/usr/local/bin/pg_ctl", buf, sizeof(buf)-1)) != -1)
    buf[len] = '\0';

Symlinks are used quite often, *especially* when dealing with relocatable
packages (read: that will likely not reside in /usr/local/, etc.). And it
would only requires two or three extra lines of code, no?

At any rate, I appreciate you looking into this.

- Mark

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #4787: Hardlink (ln) causes startup failure with bizarre "timezone_abbreviations" error
Next
From: Tom Lane
Date:
Subject: Re: BUG #4787: Hardlink (ln) causes startup failure with bizarre "timezone_abbreviations" error