Re: danger of stats_temp_directory = /dev/shm - Mailing list pgsql-hackers

From Tom Lane
Subject Re: danger of stats_temp_directory = /dev/shm
Date
Msg-id 23792.1376936908@sss.pgh.pa.us
Whole thread Raw
In response to Re: danger of stats_temp_directory = /dev/shm  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: danger of stats_temp_directory = /dev/shm  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> The implementation I chose for the actual check was to separate the
> permission checks from checkDataDir() into src/port/pgcheckdir.c that
> returns different error codes for each case; see first attachment.
> This part seems pretty reasonable, except that the code should be in
> src/common rather than src/port, but I believe the entire pgcheckdir.c
> file should be moved.

s/CKDIR_TOOACCESIBLE/CKDIR_TOOACCESSIBLE/, and maybe use underscores
to separate the words in those names?  Otherwise no objection.  But
there's not much point in this unless we can figure out where to call
it from for the stat_directory case.

One possibility is to do the initial check somewhere shortly after
ChangeToDataDir(), and have the GUC check hook only attempt to make a
check in SIGHUP context.  Unfortunately we aren't passing the context to
check hooks, only GucSource which isn't adequate for this.  Not sure if we
want to go so far as to change the check-hook API at this point.  We could
probably think of some other, klugy way to tell if it's initial startup.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Boszormenyi Zoltan
Date:
Subject: Re: UNNEST with multiple args, and TABLE with multiple funcs
Next
From: Andres Freund
Date:
Subject: Re: danger of stats_temp_directory = /dev/shm