Re: [PATCH] Find additional connection service files inpg_service.conf.d directory - Mailing list pgsql-hackers

From Andres Freund
Subject Re: [PATCH] Find additional connection service files inpg_service.conf.d directory
Date
Msg-id 20180301181340.lnvozagw2cogljni@alap3.anarazel.de
Whole thread Raw
In response to Re: [PATCH] Find additional connection service files inpg_service.conf.d directory  (Curt Tilmes <curt@tilmes.org>)
Responses Re: [PATCH] Find additional connection service files inpg_service.conf.d directory  (Curt Tilmes <curt@tilmes.org>)
List pgsql-hackers
Hi,

On 2018-03-01 13:04:35 -0500, Curt Tilmes wrote:
>On 2018-03-01 11:36:01 -0500, Curt Tilmes wrote:
>> > This is already pretty crufty, can't we make this look a bit prettier,
>> > rather than extending this approach?
>> 
>> My goal was to match the surrounding code style, so I simply copied
>> existing lines.

Yea, I think you're definitely to blame here. But I think just
continuing on the same bad trend isn't a good idea ;)


>> Do you have any specific suggestions?  Would it help if I separated
>> the new code into its own
>> subroutine?
> 
> I broke the new directory search out into its own subroutine, so even
> less impact on existing code.

I do think that helps!


>> > So there's no really well defined order in which we parse these?
>> 
>> These are after the existing homedir/sysconfdir, but yes, once we fall
>> down to the '.d' directory,
>> we just keep trying until we find the specified service, and fail if
>> we never find it.

And within the directory which service file wins will be decided by
filesystem internals. That makes me a bit uncomfortable, this very well
might not be stable.  I think it might not be terrible idea to sort the
directory and process alphabetically?

>> > In my experience with such .conf.d directories it's very useful to
>> > filter names not matching a common pattern. Otherwise you end up with
>> > editor tempfiles and such being used, which gets confusing.
>> 
>> Suggestions?  I'll make it skip over files prefixed with '.'.
>> Anything else you suggest?
>
> New patch skips over '.' dotfiles.

I'd also insist that the file ending is ".conf".


Thanks for the quick update,

Andres Freund


pgsql-hackers by date:

Previous
From: David Steele
Date:
Subject: Re: PATCH: Unlogged tables re-initialization tests
Next
From: Jesper Pedersen
Date:
Subject: Re: [HACKERS] Runtime Partition Pruning