Re: BUG #16204: Fail to setup - Mailing list pgsql-bugs
From | 小林 巧 |
---|---|
Subject | Re: BUG #16204: Fail to setup |
Date | |
Msg-id | TYAPR01MB38852D852A730811ED8DC796DA350@TYAPR01MB3885.jpnprd01.prod.outlook.com Whole thread Raw |
In response to | Re: BUG #16204: Fail to setup (Tom Lane <tgl@sss.pgh.pa.us>) |
List | pgsql-bugs |
Thanks.
>The Postgres project as such doesn't distribute systemd
>service scripts, so you'll need to take this up with
>whoever created the script you're using.
>service scripts, so you'll need to take this up with
>whoever created the script you're using.
Before I install postgresql-10 server, it is no systemd unit file:
[root@tkw-pgcl-sv003 ~]# ls -l /lib/systemd/system/posttgres*
ls: /lib/systemd/system/postgres* にアクセスできません: そのようなファイルやディレクトリはありません
But after install it be created:
[root@tkw-pgcl-sv003 ~]# ls -l /lib/systemd/system/postgres*
-rw-r--r--. 1 root root 1728 11月 30 23:29 /lib/systemd/system/postgresql-10.service
[root@tkw-pgcl-sv003 ~]# cat /lib/systemd/system/postgresql-10.service
# It's not recommended to modify this file in-place, because it will be
# overwritten during package upgrades. If you want to customize, the
# best way is to create a file "/etc/systemd/system/postgresql-10.service",
# containing
# .include /usr/lib/systemd/system/postgresql-10.service
# ...make your changes here...
# For more info about custom unit files, see
# http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F
# Note: changing PGDATA will typically require adjusting SELinux
# configuration as well.
# Note: do not use a PGDATA pathname containing spaces, or you will
# break postgresql-setup.
[Unit]
Description=PostgreSQL 10 database server
Documentation=https://www.postgresql.org/docs/10/static/
After=syslog.target
After=network.target
[Service]
Type=notify
User=postgres
Group=postgres
# Note: avoid inserting whitespace in these Environment= lines, or you may
# break postgresql-setup.
# Location of database directory
Environment=PGDATA=/var/lib/pgsql/10/data/
# Where to send early-startup messages from the server (before the logging
# options of postgresql.conf take effect)
# This is normally controlled by the global default set by systemd
# StandardOutput=syslog
# Disable OOM kill on the postmaster
OOMScoreAdjust=-1000
Environment=PG_OOM_ADJUST_FILE=/proc/self/oom_score_adj
Environment=PG_OOM_ADJUST_VALUE=0
ExecStartPre=/usr/pgsql-10/bin/postgresql-10-check-db-dir ${PGDATA}
ExecStart=/usr/pgsql-10/bin/postmaster -D ${PGDATA}
ExecReload=/bin/kill -HUP $MAINPID
KillMode=mixed
KillSignal=SIGINT
# Do not set any timeout value, so that systemd will not kill postmaster
# during crash recovery.
TimeoutSec=0
[Install]
WantedBy=multi-user.target
The systemd unit file seems to derive from the rpm package the official site distributes.
So where should I contact to solve this issue?
I installed postgresql-10 server from the repository from official website:
https://yum.postgresql.org/repopackages.php
https://yum.postgresql.org/repopackages.php
And installed commands are:
# yum -y install postgresql10-server postgresql10-contrib
# mkdir /mnt/postgres
# mkdir /mnt/postgres/data
# chown postgres:postgres /mnt/postgres/data
Best regards, Takumi Kobayashi
差出人: Tom Lane <tgl@sss.pgh.pa.us>
送信日時: 2020年1月13日 1:55
宛先: 小林 巧 <chamaharun@outlook.com>
CC: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
件名: Re: BUG #16204: Fail to setup
送信日時: 2020年1月13日 1:55
宛先: 小林 巧 <chamaharun@outlook.com>
CC: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
件名: Re: BUG #16204: Fail to setup
小林 巧 <chamaharun@outlook.com> writes:
> [root@tkw-pgcl-sv004 ~]# cat /var/lib/pgsql/10/initdb.log
> ...
> fixing permissions on existing directory /mnt/postgres/data ... ok
> ...
> Success. You can now start the database server using:
> /usr/pgsql-10/bin/pg_ctl -D /mnt/postgres/data -l logfile start
Right. So, clearly, initdb thinks it was told to initialize
/mnt/postgres/data. Looking back at your original trace,
we see it being called like this:
+ runuser -l postgres -c '/usr/pgsql-10/bin/initdb
--pgdata='\''/var/lib/pgsql/10/data/'\'' --auth='\''ident'\''
--data-checksums -E utf8 --no-locale -D /mnt/postgres/data'
^^^^^^^^^^^^^^^^^^^^^
So evidently that won out over the earlier --pgdata switch,
which is unsurprising. But it definitely looks like this
service script is confused, or else you've put a -D switch
into some option that's not supposed to contain that.
The Postgres project as such doesn't distribute systemd
service scripts, so you'll need to take this up with
whoever created the script you're using.
regards, tom lane
> [root@tkw-pgcl-sv004 ~]# cat /var/lib/pgsql/10/initdb.log
> ...
> fixing permissions on existing directory /mnt/postgres/data ... ok
> ...
> Success. You can now start the database server using:
> /usr/pgsql-10/bin/pg_ctl -D /mnt/postgres/data -l logfile start
Right. So, clearly, initdb thinks it was told to initialize
/mnt/postgres/data. Looking back at your original trace,
we see it being called like this:
+ runuser -l postgres -c '/usr/pgsql-10/bin/initdb
--pgdata='\''/var/lib/pgsql/10/data/'\'' --auth='\''ident'\''
--data-checksums -E utf8 --no-locale -D /mnt/postgres/data'
^^^^^^^^^^^^^^^^^^^^^
So evidently that won out over the earlier --pgdata switch,
which is unsurprising. But it definitely looks like this
service script is confused, or else you've put a -D switch
into some option that's not supposed to contain that.
The Postgres project as such doesn't distribute systemd
service scripts, so you'll need to take this up with
whoever created the script you're using.
regards, tom lane
pgsql-bugs by date: