RE: [EXT] Re: BUG #17469: postgresql-11.service file not configured to match setup/initdb options specified

Поиск
Список
Период
Сортировка
От Joe Hebert (jhebert)
Тема RE: [EXT] Re: BUG #17469: postgresql-11.service file not configured to match setup/initdb options specified
Дата
Msg-id SN4PR0801MB79351521B99B92DFC19D845BC7CF9@SN4PR0801MB7935.namprd08.prod.outlook.com
обсуждение исходный текст
Ответ на Re: BUG #17469: postgresql-11.service file not configured to match setup/initdb options specified  (Devrim Gündüz <devrim@gunduz.org>)
Список pgsql-bugs
Micron Confidential

Hi Devrim,

I have attached a previous response which has more details.  Those details should probably be added to the case notes.

Thanks,

Joe


Micron Confidential

-----Original Message-----
From: Devrim Gündüz <devrim@gunduz.org>
Sent: Sunday, May 15, 2022 7:07 PM
To: Joe Hebert (jhebert) <jhebert@micron.com>; pgsql-bugs@lists.postgresql.org
Subject: [EXT] Re: BUG #17469: postgresql-11.service file not configured to match setup/initdb options specified

CAUTION: EXTERNAL EMAIL. Do not click links or open attachments unless you recognize the sender and were expecting this
message.
Micron Confidential



Hi David,



Thanks for your response.  Initially I was attempting to use sudo to initialize the DB per the sample commands provided
atthe following web page: 



https://www.postgresql.org/download/linux/redhat/



From the recommended script on that page:

# Optionally initialize the database and enable automatic start:

sudo /usr/pgsql-11/bin/postgresql-11-setup initdb

sudo systemctl enable postgresql-11



Due to encountering error "failed to find PGDATA setting in /postgres/data/datafiles.service", it looked like I had
encounteredbug
#15108<https://www.postgresql.org/message-id/152094313655.1225.9005657715834235284%40wrigleys.postgresql.org>,which led
meto use initdb instead of postgresql-11-setup per Sergei's recommendation.  Below are the actual commands I used,
whichwere successful: 



/usr/pgsql-11/bin/initdb -A ldap -E utf8 -D /postgres/data/datafiles -X /postgres/tranlog

sudo systemctl enable postgresql-11



Anyway, since the above recommended commands were to be run with sudo, I presumed the systemctl template for postgresql
wouldhave been generated with the -D option value I provided embedded in the PGDATA environment variable in the
template(/usr/lib/systemd/system/postgresql-11.service).  However, after realizing that I could not use sudo with
initdb,it makes sense that it would not integrate with the postgresql-11.service template. 



I guess I am not sure where that template file comes from (and which process generates it), but it would be nice if we
didn'thave to edit the template every time we install.  On my side, finding a way to edit the file (sudo systemctl edit
--fullpostgresql-11) in an automated way (for unattended installs) may be problematic. 



Hopefully this helps explain the path I took and my thought process.



Joe







Micron Confidential

From: David G. Johnston <david.g.johnston@gmail.com>
Sent: Thursday, April 28, 2022 5:58 PM
To: Joe Hebert (jhebert) <jhebert@micron.com>; PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: [EXT] Re: BUG #17469: postgresql-11.service file not configured to match setup/initdb options specified



        CAUTION: EXTERNAL EMAIL. Do not click links or open attachments unless you recognize the sender and were
expectingthis message. 





On Thu, Apr 28, 2022 at 4:42 PM PG Bug reporting form <noreply@postgresql.org<mailto:noreply@postgresql.org>> wrote:

   The following bug has been logged on the website:

   Bug reference:      17469
   Logged by:          Joe Hebert
   Email address:      jhebert@micron.com<mailto:jhebert@micron.com>
   PostgreSQL version: 11.11
   Operating system:   RHEL 8.5
   Description:

   After researching further, I reviewed file
   /usr/lib/systemd/system/postgresql-11.service
   and found the following offending line:
   Environment=PGDATA=/var/lib/pgsql/11/data/

   Which should have been set to /postgres/data/datafiles based in the option
   provided to the initdb command.



   I'm curious to know where you got the idea that initdb integrated with systemd.  I'm under the impression it
doesn't. PostgreSQL core doesn't generally deal with such platform-specific concerns (i.e., it isn't a feature
enhancementwe would consider). 



   If you go against the conventions of your packaged distribution (or do not avail yourself of its tooling) you have
todo the customizations yourself. 



   David J.




В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #17481: sometime pg_stat_statements coredump
Следующее
От: James Coleman
Дата:
Сообщение: pg_rewind fails to detect timeline change