Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jfkSt-0005sh-Uw for pgsql-general@arkaria.postgresql.org; Mon, 01 Jun 2020 13:26:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jfkSr-0007HI-Ml for pgsql-general@arkaria.postgresql.org; Mon, 01 Jun 2020 13:26:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jfkSp-0007HA-V5 for pgsql-general@lists.postgresql.org; Mon, 01 Jun 2020 13:26:53 +0000 Received: from [66.111.4.27] (helo=out3-smtp.messagingengine.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jfkSk-0005fA-4C for pgsql-general@lists.postgresql.org; Mon, 01 Jun 2020 13:26:51 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 11A505C00EC; Mon, 1 Jun 2020 09:26:34 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 01 Jun 2020 09:26:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=P Al/NxmtjHPA4twUX6We0v9CDnxF85bfbNZfAqvbgzM=; b=URiVksjBqC1yVtq3G vmCdDvh05X3w131wFFaqXGRdTrrpmVVEyz2n/1DRoQSbYpRes/h0zBChbhM+TIjN WNWwzGZEYAma/ddh7U87Xfgzmq3nJfwID0k177zb4UnFniAFew++yqmN2wlODo6g StN6NyxgCiHPnoO46DRoMdMCgDigvyExzOEZ3750eXFjIswf8N8zjfHepqFI+iVn hBuNOY5ea1yg/yX0Zy/WsNTwFMFGx0swZ5scbH7wi339puhQri6zEsJwa1l/LA45 5YSIp+03dgJk/IewZs9BJBXjBlxZCS4jJEgbuF1F4UpArTPWhsuSsYoaUxNGUk5b DVQKw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=PAl/NxmtjHPA4twUX6We0v9CDnxF85bfbNZfAqvbg zM=; b=m1oaoqiPmNOptUaK67XHlgprw9G2lMangEQKRYztLiJbhsaBchC7/v10X ZPbAabOEoqKISfDUctguyM+hucozhx8aE5eeaEToqkwe6p8i90AjhrJw61QvLmTG ErXlDpIhbg7Z8017PBCE2PpM89LTiTuLAr9VdF397chsmWE+OBx6ieWu8Fksz2Xl CUmeBQjk8BbVWGriCbNC+Wrsf01qMfrcU9dQ9HMs2T27exTGaz533CWK0t6UT2xl eayoqAy90dVlOt5J7FTBglZzYunuSHvdzbsDnUhXW4LQhLZCIr8DY2mXEqWY8Stc m7BB1c7sEDADqP8N5T6OEA8WBJ3/w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudefhedgheeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeetjeefhefghefgjedtiedvieevvdfffefhudffgfev keeggfeiheettedugeetveenucffohhmrghinhepuggvsghirghnrdhorhhgpdhpohhsth hgrhgvshhqlhdrohhrghenucfkphepjeehrddujedvrdehrddvfedunecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvh gvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Received: from [192.168.1.3] (75-172-5-231.tukw.qwest.net [75.172.5.231]) by mail.messagingengine.com (Postfix) with ESMTPA id F0E823280063; Mon, 1 Jun 2020 09:26:31 -0400 (EDT) Subject: Re: pg_ctl can't start db server To: Tanja Savic , Tom Lane Cc: "pgsql-general@lists.postgresql.org" References: <10527.1590766334@sss.pgh.pa.us> From: Adrian Klaver Message-ID: Date: Mon, 1 Jun 2020 06:26:31 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 66.111.4.27 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 6/1/20 12:04 AM, Tanja Savic wrote: > Hi, > > @Tom Adding -D in command worked. I just used > pg_ctl start -D [data-directory ] You would be better off using the tools provided to manage clusters with the Ubuntu/Debian packaging: https://wiki.debian.org/PostgreSql So as I mentioned previously: sudo pg_ctlcluster 12 main stop sudo pg_ctlcluster 12 main start The wrapper script that drives the above takes care of the below. > > PGDATA was not set permanently although I tried to set it (with postgres user): > export PGDATA=" /var/lib/postgresql/12/main" > > @Adrian It's Ubuntu and output of pg_lsclusters was this: > 12 main 24538 online postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log > > Thank you for your replies. > BR, > Tanja > > -----Original Message----- > From: Tom Lane > Sent: Friday, May 29, 2020 5:32 PM > To: Tanja Savic > Cc: pgsql-general@lists.postgresql.org > Subject: Re: pg_ctl can't start db server > > Tanja Savic writes: >> The configuration file path is /etc/postgresql/12/main/ postgresql.conf and it is configured in /var/lib/postgresql/12/main/postmaster.opts: > >> "/usr/lib/postgresql/12/bin/postgres "-D" "/var/lib/postgresql/12/main" "-c" "config_file=/etc/postgresql/12/main/postgresql.conf" > >> Why does pg_ctl complains about the postgresql.conf path? > > I don't remember the exact interaction between -D and an explicit config_file setting, but evidently it's not working the way you wish. > See > > https://www.postgresql.org/docs/current/runtime-config-file-locations.html > > which suggests that you should use -D to point at the directory where postgresql.conf is, and set the data directory with a parameter within postgresql.conf. > > (Note that pg_ctl probably only understands this way, even though theoretically the postmaster can deal with other approaches to setting up an external config file.) > > regards, tom lane > -- Adrian Klaver adrian.klaver@aklaver.com