Re: [Pgsqlrpms-hackers] Safer auto-initdb for RPM init script - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [Pgsqlrpms-hackers] Safer auto-initdb for RPM init script
Date
Msg-id 24279.1156517135@sss.pgh.pa.us
Whole thread Raw
In response to Re: [Pgsqlrpms-hackers] Safer auto-initdb for RPM init  (Reinhard Max <max@suse.de>)
List pgsql-hackers
Reinhard Max <max@suse.de> writes:
> Another flaw of the flag-file method is, that PGDATA might have been 
> changed by the sysadmin between installing the RPM and calling the 
> init script for the first time.

What problem do you see there?  With either of these methods, a manual
change in PGDATA would require a manual initdb before the postmaster
would start.  That seems like a good conservative thing to me.

(Actually, with the flag-file method you could get the initscript
to run initdb for you by hand-creating the flag file, but it seems
unlikely people would do that in practice.)

> But shouldn't mountpoints always have 000 permissions to prevent 
> writing into the directory as long as nothing is mounted to it?

Not sure that that helps much given that the initscript runs as root.
And in any case the point here is to protect against human error,
not to assume that the installation is managed according to very
best practices.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [Pgsqlrpms-hackers] Safer auto-initdb for RPM init
Next
From: Gregory Stark
Date:
Subject: Re: Safer auto-initdb for RPM init script