pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Adrian Klaver <adrian.klaver@aklaver.com>
To: Chatterjee, Shibayan <shibayan.chatterjee@centurylink.com>
To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: Issue: Creating Symlink for data directory of postgresql in CentOS7
Date: Sun, 14 Jul 2019 17:05:27 +0200
Message-ID: <fd69d7529cf8f249942acf389a01bd347bcada96.camel@cybertec.at> (raw)
In-Reply-To: <e3922841-d703-60a1-54f9-cc3756bfa7d7@aklaver.com>
References: <edcbd415540549e4aa36c92e7dba0a5c@level3.com>
	<480fa09c6fba11c2b79724d3b5ffdd385822a295.camel@cybertec.at>
	<0c92d81eb54c4fc3b6c82beab07115d2@level3.com>
	<5580d9b85babc6d531cb8aa8a44cae1d2d2ab836.camel@cybertec.at>
	<e3922841-d703-60a1-54f9-cc3756bfa7d7@aklaver.com>

Adrian Klaver wrote:
> On 7/13/19 4:30 AM, Laurenz Albe wrote:
> > On Fri, 2019-07-12 at 18:08 +0000, Chatterjee, Shibayan wrote:
> > > > Jul 12 10:00:51 postgresql-check-db-dir: "/data/postgresql/data" is missing or empty.
> > > > Jul 12 10:00:51 postgresql-check-db-dir: Use "postgresql-setup initdb" to initialize the database cluster.
> > > > Jul 12 10:00:51 postgresql-check-db-dir: See /usr/share/doc/postgresql-9.2.24/README.rpm-dist for more information.
> > > 
> > > For sure there's all the necessary files in '/data/postgresql/data'.
> > > The startup process cannot read it, because of sym link.
> > 
> > Well, where is the source for this fabled "postgresql-check-db-dir"?
> 
> https://git.postgresql.org/gitweb/?p=pgrpms.git;a=blob;f=rpm/redhat/9.2/postgresql/EL-7/postgresql92...

Thanks.  I read this:

  30 # Check for the PGDATA structure
  31 if [ -f "$PGDATA/PG_VERSION" ] && [ -d "$PGDATA/base" ]
  32 then
     [...]
  49 else
  50     # No existing PGDATA! Warn the user to initdb it.
  51     echo $"\"$PGDATA\" is missing or empty."
  52     echo $"Use \"/usr/pgsql-9.2/bin/postgresql92-setup initdb\" to initialize the database cluster."
  53     echo $"See $PGDOCDIR/README.rpm-dist for more information."
  54     exit 1
  55 fi

That means that either there was no regular file /data/postgresql/data/PG_VERSION
or no directory /data/postgresql/data/base, or that the user running the script
lacked the permissions to access them.

Since you say that there was a regular data directory there, that would point
to permission problems.

Witn that information, it should be simple to debug the problem.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






view thread (12+ messages)  latest in thread

Message-ID: <fd69d7529cf8f249942acf389a01bd347bcada96.camel@cybertec.at>
Permalink:  ../fd69d7529cf8f249942acf389a01bd347bcada96.camel@cybertec.at/
Also on:    postgresql.org/message-id/fd69d7529cf8f249942acf389a01bd347bcada96.camel@cybertec.at

 · 

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-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, adrian.klaver@aklaver.com, shibayan.chatterjee@centurylink.com
  Subject: Re: Issue: Creating Symlink for data directory of postgresql in CentOS7
  In-Reply-To: <fd69d7529cf8f249942acf389a01bd347bcada96.camel@cybertec.at>
  References: <edcbd415540549e4aa36c92e7dba0a5c@level3.com> <480fa09c6fba11c2b79724d3b5ffdd385822a295.camel@cybertec.at> <0c92d81eb54c4fc3b6c82beab07115d2@level3.com> <5580d9b85babc6d531cb8aa8a44cae1d2d2ab836.camel@cybertec.at> <e3922841-d703-60a1-54f9-cc3756bfa7d7@aklaver.com> <fd69d7529cf8f249942acf389a01bd347bcada96.camel@cybertec.at>

* 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