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 1j2T8I-0002Ig-FD for pgsql-general@arkaria.postgresql.org; Fri, 14 Feb 2020 05:03:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j2T7I-00066m-RY for pgsql-general@arkaria.postgresql.org; Fri, 14 Feb 2020 05:02:16 +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 1j2T7G-00066Z-UI for pgsql-general@lists.postgresql.org; Fri, 14 Feb 2020 05:02:16 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j2T79-000271-HG for pgsql-general@lists.postgresql.org; Fri, 14 Feb 2020 05:02:13 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 0347E220B8; Fri, 14 Feb 2020 00:02:06 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 14 Feb 2020 00:02:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=i P4Ua8SMdQPlaNX5Zd7FBOMvRg0mp2R3yIAekjwICvs=; b=T+AKSpAGTa3Lm01o7 XKriURufpeFnS00aeJb+9YFklcYuLfoQGOvQ9TDC1K6sRW7SZLkykAdgjKhNqVRY n6hd3kbM0StU6LPBnYDa5OL39zGbhL8QKDqyBUE0KwRBJ7VJm9snQFoJdWusQttk Z6YxrR744ieegW/Z57MPZ2AYNAItWzo652kwZCqJp3TItdBKs6qNrA5bvJvUlzsn FZvB+nktSJMzWF6zzFP4yKDij99xzDbYbpEPx0WfjS2AcMrRY1/cr17r14xPZpN2 7aiql1kf9M/JPQONP5Bz+zJ6E4u1/qKFULBrS6Pfm0OxlAKfRTjpqGD0nb6e34Go ojZCA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=iP4Ua8SMdQPlaNX5Zd7FBOMvRg0mp2R3yIAekjwIC vs=; b=1ekU00piEvMFZ2Ap1ThGz1YSEeJX2VpnYABbnm6i8M0dlGWqNdPoiSCA6 jcrk3ye9oZG4GIzPhm6tCA32t2+ZFbL/OyG+PkAHtJ/aekk0dnPujFLj73usxubC evClgDnpQ5RR54lW5DGQu2lc20lbe9asmZCTFu2xQsnSuV03KxJ2z3iA6A0cL14z hjmo7eMq6SpbC2iBV8OOzyJ713bIP5cJ55aB9IxsnJIICq6kWr3FUTTGmLhwJpFf EGPxSHCr+iXlWApDuo3/gYF7LrOi+Xh0Uok07sDd2401YNiHf1wfhVUuhDqAgSNO hucvXKbrBrA2W7iT4+71vhPJJef5g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrieelgdejlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecukfhppeejuddrvdduvddruddvledrudelfeenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrg hvvghrrdgtohhm X-ME-Proxy: Received: from [192.168.1.10] (unknown [71.212.129.193]) by mail.messagingengine.com (Postfix) with ESMTPA id 52BFE3060F09; Fri, 14 Feb 2020 00:02:05 -0500 (EST) Subject: Re: Cannot connect to postgresql-11 from another machine after boot To: Jason Swails , pgsql-general@lists.postgresql.org References: From: Adrian Klaver Message-ID: <4e04fcba-2921-df12-c1a5-7a3eb5afb1eb@aklaver.com> Date: Thu, 13 Feb 2020 21:02:04 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2/13/20 7:54 PM, Jason Swails wrote: > Hi, > > I've been struggling with a strange (to me) issue for awhile.  I have > PostgreSQL 11.6 installed on my Ubuntu machine with the data directory > living on a different drive than the one mounted on /. I was observing > the same behavior when my machine was running Gentoo a month ago. > > The problem is that after my machine boots, I'm unable to connect to the > server from anywhere except localhost.  Running a simple "systemctl > restart postgresql" fixes the problem and allows me to connect from > anywhere on my LAN.  Here is an example of this behavior: > > swails@client ~ $ psql -U postgres -h 192.168.1.3 > psql: could not connect to server: Connection refused > Is the server running on host "192.168.1.3" and accepting > TCP/IP connections on port 5432? > > swails@client ~ $ ssh 192.168.1.3 > > swails@server ~ $ sudo systemctl restart postgresql > > swails@server ~ $ logout > Connection to 192.168.1.3 closed. > > swails@client ~ $ psql -U postgres -h 192.168.1.3 > Password for user postgres: > > So the first connection attempt fails.  But when I restart the service > and try again (doing nothing else in between), the connection attempt > succeeds.  My workaround has been to simply restart the service every > time my machine reboots, but I'd really like to have a more reliable > startup. > > Any ideas how to start hunting down the root cause?  I think this > started happening after I moved the data directory to another drive. I would start by looking in the system log to see what it records when the service tries to start on reboot. > > Thanks, > Jason > > -- > Jason M. Swails -- Adrian Klaver adrian.klaver@aklaver.com