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 1hlur0-00057M-FM for pgsql-general@arkaria.postgresql.org; Fri, 12 Jul 2019 12:40:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hluqy-0003Nl-EU for pgsql-general@arkaria.postgresql.org; Fri, 12 Jul 2019 12:40:44 +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 1hlsX4-0000Qg-1o for pgsql-general@lists.postgresql.org; Fri, 12 Jul 2019 10:12:02 +0000 Received: from lxdnp29m.centurylink.com ([155.70.32.52]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hlsX0-0004fS-Ma for pgsql-general@postgresql.org; Fri, 12 Jul 2019 10:12:00 +0000 Received: from lxdnp04n.corp.intranet (lxdnp04n.corp.intranet [151.119.92.83]) by lxdnp29m.centurylink.com (8.14.8/8.14.8) with ESMTP id x6CABv3b053459 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 12 Jul 2019 04:11:57 -0600 Received: from lxdnp04n.corp.intranet (localhost [127.0.0.1]) by lxdnp04n.corp.intranet (8.14.8/8.14.8) with ESMTP id x6CABqQo022671 for ; Fri, 12 Jul 2019 04:11:52 -0600 Received: from lxomp06u.corp.intranet (lxdnp23m.corp.intranet [151.119.92.134]) by lxdnp04n.corp.intranet (8.14.8/8.14.8) with ESMTP id x6CABpem022668 (version=TLSv1/SSLv3 cipher=AES256-SHA256 bits=256 verify=NO) for ; Fri, 12 Jul 2019 04:11:52 -0600 Received: from lxomp06u.corp.intranet (localhost [127.0.0.1]) by lxomp06u.corp.intranet (8.14.8/8.14.8) with ESMTP id x6CABpk4011313 for ; Fri, 12 Jul 2019 05:11:51 -0500 Received: from usidc2wveedge01.corp.global.level3.com (usidc2wveedge01.corp.global.level3.com [4.68.50.20]) by lxomp06u.corp.intranet (8.14.8/8.14.8) with ESMTP id x6CABo3U011305 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 12 Jul 2019 05:11:51 -0500 Received: from usidc2wvembx09.corp.global.level3.com (4.72.132.18) by usidc2wveedge01.corp.global.level3.com (4.68.50.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.26; Fri, 12 Jul 2019 04:11:50 -0600 Received: from usidc2wvembx10.corp.global.level3.com (4.72.132.19) by usidc2wvembx09.corp.global.level3.com (4.72.132.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1415.2; Fri, 12 Jul 2019 04:11:49 -0600 Received: from usidc2wvembx10.corp.global.level3.com ([4.72.132.19]) by usidc2wvembx10.corp.global.level3.com ([4.72.132.19]) with mapi id 15.01.1415.002; Fri, 12 Jul 2019 04:11:49 -0600 From: "Chatterjee, Shibayan" To: "pgsql-general@postgresql.org" Subject: Issue: Creating Symlink for data directory of postgresql in CentOS7 Thread-Topic: Issue: Creating Symlink for data directory of postgresql in CentOS7 Thread-Index: AdU4ixAgMosRk8CxS6SC65GJ6FUKAA== Date: Fri, 12 Jul 2019 10:11:49 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.5.157.11] Content-Type: multipart/alternative; boundary="_000_edcbd415540549e4aa36c92e7dba0a5clevel3com_" MIME-Version: 1.0 X-TM-AS-MML: disable X-CFilter-Loop: Reflected List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --_000_edcbd415540549e4aa36c92e7dba0a5clevel3com_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, I'm trying to create a symlink for 'data' directory present in '/var/lib/pg= sql/', pointing to different location. After providing exact access permissions and ownership to postgres, I'm sti= ll unable to restart postgres after modifications. I've also modified '/var/lib/pgsql/postgresql.conf' and '/usr/lib/systemd/s= ystem/postgresql.service' to point the $PGDATA location to the actual desti= nation as respectively: data_directory =3D '/data/postgresql/data' Environment=3DPGDATA=3D/data/postgresql/data Can you guys help ? I tried searching a solution for this problem but still= couldn't get a perfect solution. Here's what I'm seeing in: >>> systemctl status postgresql.service postgresql.service - PostgreSQL database server Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; ven= dor preset: disabled) Active: failed (Result: exit-code) since Fri 2019-07-12 10:00:51 UTC; 38= s ago Process: 8852 ExecStartPre=3D/usr/bin/postgresql-check-db-dir ${PGDATA} (= code=3Dexited, status=3D1/FAILURE) Main PID: 29483 (code=3Dexited, status=3D0/SUCCESS) Jul 12 10:00:51 systemd[1]: Starting PostgreSQL database server... Jul 12 10:00:51 systemd[1]: postgresql.service: control process exited, cod= e=3Dexited status=3D1 Jul 12 10:00:51 systemd[1]: Failed to start PostgreSQL database server. Jul 12 10:00:51 systemd[1]: Unit postgresql.service entered failed state. Jul 12 10:00:51 systemd[1]: postgresql.service failed. >>> /var/log/messages Jul 12 10:00:51 systemd: Starting PostgreSQL database server... 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 i= nitialize 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. Jul 12 10:00:51 systemd: postgresql.service: control process exited, code= =3Dexited status=3D1 Jul 12 10:00:51 systemd: Failed to start PostgreSQL database server. Jul 12 10:00:51 systemd: Unit postgresql.service entered failed state. Jul 12 10:00:51 systemd: postgresql.service failed. -Shibayan This communication is the property of CenturyLink and may contain confident= ial or privileged information. Unauthorized use of this communication is st= rictly prohibited and may be unlawful. If you have received this communicat= ion in error, please immediately notify the sender by reply e-mail and dest= roy all copies of the communication and any attachments. --_000_edcbd415540549e4aa36c92e7dba0a5clevel3com_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi,<= /p>

I’m trying to cr= eate a symlink for ‘data’ directory present in ‘/var/lib/= pgsql/’, pointing to different location.

After providing exact = access permissions and ownership to postgres, I’m still unable to res= tart postgres after modifications.

 

I’ve also modifi= ed ‘/var/lib/pgsql/postgresql.conf’ and ‘/usr/lib/systemd= /system/postgresql.service’ to point the $PGDATA location to the actu= al destination as respectively:

 

data_directory =3D '/data/postgresql/data'

Environment=3DPGDATA=3D/data/postgresql/data<= /p>

 

 

Can you guys help ? I = tried searching a solution for this problem but still couldn’t get a = perfect solution.

 

Here’s what I= 217;m seeing in:

>>> systemctl status postgresql.service

 

postgresql.service - PostgreSQL database server

   Loaded: loaded (/usr/lib/systemd/system/postgresql= .service; enabled; vendor preset: disabled)

   Active: failed (Result: exit-code) since Fri 2019-= 07-12 10:00:51 UTC; 38s ago

  Process: 8852 ExecStartPre=3D/usr/bin/postgresql-check-d= b-dir ${PGDATA} (code=3Dexited, status=3D1/FAILURE)

Main PID: 29483 (code=3Dexited, status=3D0/SUCCESS)<= /span>

 

Jul 12 10:00:51 systemd[1]: Starting PostgreSQL database server= ...

Jul 12 10:00:51 systemd[1]: postgresql.service: control process= exited, code=3Dexited status=3D1

Jul 12 10:00:51 systemd[1]: Failed to start PostgreSQL database= server.

Jul 12 10:00:51 systemd[1]: Unit postgresql.service entered fai= led state.

Jul 12 10:00:51 systemd[1]: postgresql.service failed.

 

>>> /var/log/messages

 

Jul 12 10:00:51 systemd: Starting PostgreSQL database server...=

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-s= etup initdb" to initialize the database cluster.

Jul 12 10:00:51 postgresql-check-db-dir: See /usr/share/doc/pos= tgresql-9.2.24/README.rpm-dist for more information.

Jul 12 10:00:51 systemd: postgresql.service: control process ex= ited, code=3Dexited status=3D1

Jul 12 10:00:51 systemd: Failed to start PostgreSQL database se= rver.

Jul 12 10:00:51 systemd: Unit postgresql.service entered failed= state.

Jul 12 10:00:51 systemd: postgresql.service failed.<= /span>

 

 

-Shibayan

 

This communication is the property of CenturyLink and may contain confident= ial or privileged information. Unauthorized use of this communication is st= rictly prohibited and may be unlawful. If you have received this communicat= ion in error, please immediately notify the sender by reply e-mail and destroy all copies of the communicat= ion and any attachments. --_000_edcbd415540549e4aa36c92e7dba0a5clevel3com_--