Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vlZVO-000sKM-2Q for pgsql-general@arkaria.postgresql.org; Thu, 29 Jan 2026 21:24:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vlZVM-00196k-0W for pgsql-general@arkaria.postgresql.org; Thu, 29 Jan 2026 21:24:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vlZVL-00196W-2c for pgsql-general@lists.postgresql.org; Thu, 29 Jan 2026 21:24:44 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vlZVK-0001pY-0U for pgsql-general@lists.postgresql.org; Thu, 29 Jan 2026 21:24:43 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 60TLOdOw1363740; Thu, 29 Jan 2026 16:24:39 -0500 From: Tom Lane To: Adrian Klaver cc: "stevej@stevej.name" , pgsql-general@lists.postgresql.org Subject: Re: What happens if the socket lock file is deleted? In-reply-to: References: Comments: In-reply-to Adrian Klaver message dated "Thu, 29 Jan 2026 12:40:06 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1363738.1769721879.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 29 Jan 2026 16:24:39 -0500 Message-ID: <1363739.1769721879@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Adrian Klaver writes: > From here at ~line 1781: > https://github.com/postgres/postgres/blob/master/src/backend/postmaster/= postmaster.c > /* > * Once a minute, verify that postmaster.pid hasn't been removed= or > * overwritten. If it has, we force a shutdown. Actually, Steve was asking about socket lock files, so the relevant code fragment is the bit just below that: /* * Touch Unix socket and lock files every 58 minutes, to ensure th= at * they are not removed by overzealous /tmp-cleaning tasks. We as= sume * no one runs cleaners with cutoff times of less than an hour ... */ if (now - last_touch_time >=3D 58 * SECS_PER_MINUTE) { TouchSocketFiles(); TouchSocketLockFiles(); last_touch_time =3D now; } regards, tom lane