pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: chamaharun@outlook.com
Subject: BUG #16204: Fail to setup
Date: Sat, 11 Jan 2020 15:22:54 +0000
Message-ID: <16204-d78de1072fe55ae4@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      16204
Logged by:          Takumi Kobayashi
Email address:      chamaharun@outlook.com
PostgreSQL version: 10.11
Operating system:   CentOS7
Description:        

I installed postgresql10.11 and ran postgresql-10-setup but it fails.
Maybe character $ for variable of PG_VERSION is missing in
/usr/pgsql-10/bin/postgresql-10-setup below :

150 
151     if [ -f "$PGDATA/PG_VERSION" ]; then
152         return 0
153     fi
154     return 1
155 }
156 
157 initdb(){
158     if [ -f "$PGDATA/PG_VERSION" ]; then
159         echo $"Data directory is not empty!"
160         echo


These are my environment:

[root@tkw-pgcl-sv004 ~]# rpm -qa | grep postgres
postgresql10-10.11-2PGDG.rhel7.x86_64
postgresql10-server-10.11-2PGDG.rhel7.x86_64
postgresql10-libs-10.11-2PGDG.rhel7.x86_64
postgresql10-contrib-10.11-2PGDG.rhel7.x86_64

[root@tkw-pgcl-sv004 ~]# cat /etc/redhat-release 
CentOS Linux release 7.7.1908 (Core)
[root@tkw-pgcl-sv004 ~]# yum list installed | grep postgresql10
postgresql10.x86_64                   10.11-2PGDG.rhel7              
@pgdg10   
postgresql10-contrib.x86_64           10.11-2PGDG.rhel7              
@pgdg10   
postgresql10-libs.x86_64              10.11-2PGDG.rhel7              
@pgdg10   
postgresql10-server.x86_64            10.11-2PGDG.rhel7              
@pgdg10   
[root@tkw-pgcl-sv004 ~]# 

And log is here:

[root@tkw-pgcl-sv004 ~]# PGSETUP_INITDB_OPTIONS="--data-checksums -E utf8
--no-locale -D /mnt/postgres/data" bash -x
/usr/pgsql-10/bin/postgresql-10-setup initdb
+ PGVERSION=10
++ echo 10
++ sed 's/^\([0-9]*\.[0-9]*\).*$/\1/'
+ PGMAJORVERSION=10
+ PGENGINE=/usr/pgsql-10/bin
+ PREVMAJORVERSION=9.6
+ PREVPGENGINE=/usr/pgsql-9.6/bin
+ PREVDATADIR=/var/lib/pgsql/9.6/data
+ SERVICE_NAME=
+ '[' x = x ']'
+ SERVICE_NAME=postgresql-10
+ OLD_SERVICE_NAME=
+ '[' x = x ']'
+ OLD_SERVICE_NAME=postgresql-9.6
+ USAGE_STRING='
Usage: /usr/pgsql-10/bin/postgresql-10-setup {initdb|check_upgrade|upgrade}
[SERVICE_NAME]

Script is aimed to help sysadmin with basic database cluster
administration.

The SERVICE_NAME is used for selection of proper unit configuration file;
For
more info and howto/when use this script please look at the docu file
.  The '\''postgresql'\''
string is used when no SERVICE_NAME is explicitly passed.

Available operation mode:
  initdb        Create a new PostgreSQL database cluster.  This is usually
the
                first action you perform after PostgreSQL server
installation.
  check_upgrade Checks whether the old cluster can be upgraded to the new
version
                or not.
  upgrade       Upgrade PostgreSQL database cluster to be usable with new
                server.  Use this if you upgraded your PostgreSQL server
to
                newer major version (currently from 9.6 to 10).

Environment:
  PGSETUP_INITDB_OPTIONS     Options carried by this variable are passed
to
                             subsequent call of `initdb` binary (see man
                             initdb(1)).  This variable is used also
during
                             '\''upgrade'\'' mode because the new cluster is
actually
                             re-initialized from the old one.
  PGSETUP_PGUPGRADE_OPTIONS  Options in this variable are passed next to
the
                             subsequent call of `pg_upgrade`.  For more
info
                             about possible options please look at man
                             pg_upgrade(1).
  PGSETUP_DEBUG              Set to '\''1'\'' if you want to see debugging
output.'
+ case "$1" in
++ systemctl show -p Environment postgresql-10.service
++ sed 's/^Environment=//'
++ tr ' ' '\n'
++ tail -n 1
++ sed -n 's/^PGDATA=//p'
+ PGDATA=/var/lib/pgsql/10/data/
+ '[' x/var/lib/pgsql/10/data/ = x ']'
+ '[' -f /etc/systemd/system/postgresql-10.service ']'
+ '[' -f /usr/lib/systemd/system/postgresql-10.service ']'
+ SERVICE_FILE=/usr/lib/systemd/system/postgresql-10.service
+ PGUPLOG=/var/lib/pgsql/10/pgupgrade.log
+ PGLOG=/var/lib/pgsql/10/initdb.log
+ export PGDATA
+ '[' -x /sbin/runuser ']'
+ SU=runuser
+ script_result=0
+ case "$1" in
+ initdb
+ '[' -f /var/lib/pgsql/10/data//PG_VERSION ']'
+ echo -n 'Initializing database ... '
Initializing database ... + perform_initdb
+ '[' '!' -e /var/lib/pgsql/10/data/ ']'
+ '[' -x /sbin/restorecon ']'
+ /sbin/restorecon /var/lib/pgsql/10/data/
+ '[' '!' -e /var/lib/pgsql/10/initdb.log -a '!' -h
/var/lib/pgsql/10/initdb.log ']'
+ touch /var/lib/pgsql/10/initdb.log
+ chown postgres:postgres /var/lib/pgsql/10/initdb.log
+ chmod go-rwx /var/lib/pgsql/10/initdb.log
+ '[' -x /sbin/restorecon ']'
+ /sbin/restorecon /var/lib/pgsql/10/initdb.log
+ initdbcmd='/usr/pgsql-10/bin/initdb
--pgdata='\''/var/lib/pgsql/10/data/'\'' --auth='\''ident'\'''
+ initdbcmd+=' --data-checksums -E utf8 --no-locale -D /mnt/postgres/data'
+ 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'
+ mkdir /var/lib/pgsql/10/data//log
+ chown postgres:postgres /var/lib/pgsql/10/data//log
+ chmod go-rwx /var/lib/pgsql/10/data//log
+ '[' -x /sbin/restorecon ']'
+ /sbin/restorecon /var/lib/pgsql/10/data//log
+ '[' -f /var/lib/pgsql/10/data//PG_VERSION ']'
+ return 1
+ echo 'failed, see /var/lib/pgsql/10/initdb.log'
failed, see /var/lib/pgsql/10/initdb.log
+ script_result=1
+ echo

+ exit 1



view thread (5+ messages)  latest in thread

Message-ID: <16204-d78de1072fe55ae4@postgresql.org>
Permalink:  ../16204-d78de1072fe55ae4@postgresql.org/
Also on:    postgresql.org/message-id/16204-d78de1072fe55ae4@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, chamaharun@outlook.com
  Subject: Re: BUG #16204: Fail to setup
  In-Reply-To: <16204-d78de1072fe55ae4@postgresql.org>
  References: <16204-d78de1072fe55ae4@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox