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 1hlwpa-0001Tj-NM for pgsql-general@arkaria.postgresql.org; Fri, 12 Jul 2019 14:47:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hlwpZ-0002qu-Fv for pgsql-general@arkaria.postgresql.org; Fri, 12 Jul 2019 14:47:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hlwpZ-0002qm-1t for pgsql-general@lists.postgresql.org; Fri, 12 Jul 2019 14:47:25 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hlwpW-0005qC-B9 for pgsql-general@postgresql.org; Fri, 12 Jul 2019 14:47:24 +0000 Received: by mail-wr1-x444.google.com with SMTP id p17so10241104wrf.11 for ; Fri, 12 Jul 2019 07:47:21 -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=E7gJXkKtVXKQi1Dm3CSrmRQi7px2NWsvv57aBLcMfAs=; b=Jb6NQwIDSCwWmZgSUplqXmrlIDbLv7sb8b2cyPDd+EIo2rDTLZF3PPobMp47Tw1P4M ANvqISD1jJzQa+p4sgVlPvysx7n3tBkTlocZJDApe7l+8A9wUoo6L19hArZdDC9tGarO 9H6uEcvDH5qq70tqgAIUAjFdUrOwcNRlKFoMve+UTBbAO+sWYlIj7H68j95d9OAodXwh QzJPmupvf8i6YI4LA1On5cSlQtb0ary9zE77fG6e675FEXz8IsfReYPEWHr0M/1MukIJ TKwoNXGxDMbbjX1+L7UH8CQT8EhbYp+qPQ/42Ufp1LXuLNXgpcSi6v3Ia5Mi6H8zx/ET Pb7g== 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=E7gJXkKtVXKQi1Dm3CSrmRQi7px2NWsvv57aBLcMfAs=; b=iIKLghDuPrHxD2qhNfza4ro/JweaQYUpqwrz8XxtQ7V2jutUNyUp8rFpPzo0xfxgSG bP/l2EjSN2n7gDrk7/5MX1EEHSjahn57nzcchn0HjPZgcSlezBRYoyVPZQG5JFFMvQYn HcmqbiUi8o6pmCsnC/EEEyLJuqdfysBEK/ZpTPDjz6GkWtmb6cpf6kp11/KHSaWs8olm fU/SnuLAWC1th+iEMjpirlLH+ZKwpQdPP+bID9CFE8J29wMF2XOxzDvPvOgtpDGhb0bq QMtASJqGym6HqOcfAdqIOh0jyya6gGZamZNilUcLeDRdR/8Y1Jsph0aFp3zg/X6Cn+JB +r6g== X-Gm-Message-State: APjAAAU4bYWKR9oIBjEg2kcpjpd+6RFW1Q1jO2ja3cx13JtXXlzYthtW 10PuNKiak8ODaPxmF2W6hTc= X-Google-Smtp-Source: APXvYqycslNJpOZq+ccEJnu0M3vOSHYM0KAybRQmCG/+V6p1EieMZ6HzbVj9gSUYvskV3i50/jUwCQ== X-Received: by 2002:adf:ee87:: with SMTP id b7mr12930437wro.61.1562942841146; Fri, 12 Jul 2019 07:47:21 -0700 (PDT) Received: from localhost.localdomain (217-149-173-242.nat.highway.telekom.at. [217.149.173.242]) by smtp.gmail.com with ESMTPSA id n14sm12483692wra.75.2019.07.12.07.47.20 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 12 Jul 2019 07:47:20 -0700 (PDT) Message-ID: <480fa09c6fba11c2b79724d3b5ffdd385822a295.camel@cybertec.at> Subject: Re: Issue: Creating Symlink for data directory of postgresql in CentOS7 From: Laurenz Albe To: "Chatterjee, Shibayan" , "pgsql-general@postgresql.org" Date: Fri, 12 Jul 2019 16:47:19 +0200 In-Reply-To: References: 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: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, 2019-07-12 at 10:11 +0000, Chatterjee, Shibayan wrote: > I’m trying to create 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 restart postgres after modifications. > > I’ve also modified ‘/var/lib/pgsql/postgresql.conf’ and ‘/usr/lib/systemd/system/postgresql.service’ > to point the $PGDATA location to the actual destination as respectively: > > data_directory = '/data/postgresql/data' > Environment=PGDATA=/data/postgresql/data [...] > >>> /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 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. > Jul 12 10:00:51 systemd: postgresql.service: control process exited, code=exited status=1 > 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. So there is some "postgresql-check-db-dir" (not part of PostgreSQL) that complains that there is nothing in /data/postgresql/data. Is that accurate? It looks like you succeeded in getting the startup process to look for the PostgreSQL data directory in the new location, but - alas - there is no data directory there yet. You could follow the instructions and run "initdb" to create the data directory. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com