Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hmg4Q-0001ny-Tl for pgsql-general@arkaria.postgresql.org; Sun, 14 Jul 2019 15:05:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hmg4N-000360-P4 for pgsql-general@arkaria.postgresql.org; Sun, 14 Jul 2019 15:05:43 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hmg4N-00035s-92 for pgsql-general@lists.postgresql.org; Sun, 14 Jul 2019 15:05:43 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hmg4J-0007cy-UH for pgsql-general@postgresql.org; Sun, 14 Jul 2019 15:05:41 +0000 Received: by mail-wr1-x442.google.com with SMTP id n9so14528078wru.0 for ; Sun, 14 Jul 2019 08:05:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=b2yQ43p0ZcQdRFhfMfUoMexPjCw/sIH6Zcxu8glvf14=; b=jAEMvsioEZqobOyi17HxGV2OwjMWb0gZeyLuZEPBiBKpUwl/+4lDi1/e9YPVq/GFCS 1oQzLT5IkuRnTmnO4RlpPUwK7l+xVpTvQC2kHWHurxGt+yo0i358KbVZJBpItkrSg2gV hZUXy80x8gK8CKcmLGEbzJdf+GuDgVto1LfOf762/XHnCA52Dnq5FIEHV1G9ObJLZKNq 2WyU/E/JDw+8/ZlZpDHKlyZmTChtX0ZbT+S8Y2G0LOZyFEquIHRjpbZbLaXR+pHvax78 sl/2G5riq025PMR166eXg99KAdIVLIMmsCdpbiC4a1ySDuD2eUob5OpdCKKaleq6n59I trAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=b2yQ43p0ZcQdRFhfMfUoMexPjCw/sIH6Zcxu8glvf14=; b=npLcxzHicXQ+FyfHRiDpYD6Md3Ybdptcjo4TaHaR1heTqa9qF8ETqPDoLkkCKlnLAE 6Ad8BfJ6fJ6dd1PnoZ0R/cIT8HmVkArAbVChoRraJyodK6278USphJG7WiZR+KaeoY2/ y9/xXoGEsBdp8bRmjUrxaEm8uRNQmpDjICYHZiA68DC1sRqU5g5YRIIHJqzasWvtDv0M XftKCZZPPXmnVwFbvFOSPI2YdzaSg0QXSYASgV7PCZRhcZ9fRAnRSqbeoEFnvZ3QxIoE PlHWQicDh8C+DIAVfg+/0WaHoAast5nBgq8LROKtkvheZ7nQ0eg6GzaZ19+j+FJ4cRBk HXBg== X-Gm-Message-State: APjAAAWczRKdR8V1UppQR1xzbCwUQM12XMfrVULfjxTHwkj1TK1XC72T N8MBM+7SzuAvMB3mmC2yuSpFJaUM X-Google-Smtp-Source: APXvYqzveaRLtjw+hzxfPCv7fGF44YWOU3lzftpQkG+S3OxAMEjAXHUv9cyLcpiwt/5Ny/hWQpG3Xg== X-Received: by 2002:a5d:5308:: with SMTP id e8mr23124287wrv.219.1563116737999; Sun, 14 Jul 2019 08:05:37 -0700 (PDT) Received: from localhost.localdomain ([46.183.103.8]) by smtp.gmail.com with ESMTPSA id s2sm11508374wmj.33.2019.07.14.08.05.36 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 14 Jul 2019 08:05:37 -0700 (PDT) Message-ID: Subject: Re: Issue: Creating Symlink for data directory of postgresql in CentOS7 From: Laurenz Albe To: Adrian Klaver , "Chatterjee, Shibayan" , "pgsql-general@postgresql.org" Date: Sun, 14 Jul 2019 17:05:27 +0200 In-Reply-To: References: <480fa09c6fba11c2b79724d3b5ffdd385822a295.camel@cybertec.at> <0c92d81eb54c4fc3b6c82beab07115d2@level3.com> <5580d9b85babc6d531cb8aa8a44cae1d2d2ab836.camel@cybertec.at> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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-check-db-dir;h=550b31770cabacf32cbb1b8f272e8ce305fc9908;hb=HEAD 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