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 1vxRBI-00E2ax-13 for pgsql-docs@arkaria.postgresql.org; Tue, 03 Mar 2026 14:57:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vxRBF-007OK1-2c for pgsql-docs@arkaria.postgresql.org; Tue, 03 Mar 2026 14:57:02 +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 1vxRBF-007OJF-1B for pgsql-docs@lists.postgresql.org; Tue, 03 Mar 2026 14:57:02 +0000 Received: from mail-ot1-x32c.google.com ([2607:f8b0:4864:20::32c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vxRBD-00000000C1c-3YGQ for pgsql-docs@postgresql.org; Tue, 03 Mar 2026 14:57:00 +0000 Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-7d556c1a79eso7685525a34.3 for ; Tue, 03 Mar 2026 06:56:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772549819; cv=none; d=google.com; s=arc-20240605; b=BUu9xfZkMmKwCssC2HywWwJ7+f21q2pCVck7eB5guUclxqebI7u0+nqCIC6V47uS9w wgJiNGQtVbOgUHvZYPLI/yRRkHdfsrQlKmvvXCsZU8Z9YzDVpgMJUva9CNIoAxTaLJhc pqz7G5H4ebQTxbtVcqg0jCVpafL4LWrFyNGkaFCyel4n75DkPHxuRJu0L8ZI+4sYFO/p 583bEcToLDV3r/FLaO0tFaGh5tfRikWcVDGdRk4xaLaSGe/pnFh7G8d4CYn3k/bN5Xle JQYZsscN7ulouBfxAHSF//v/HuTum8RkrWNhbQJPIqcBgwpCFujDUWxOgfQKwaNghcdI xasw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=oZ8k1ySLfcroRgtZoscW1jOJfSgryraPo7a7P5w2bg0=; fh=KFsZtqb4AX01K2CKX6iS1RKbkLHf2ZvrrxjU50pk2Tc=; b=ANDvdbdodR3kTno56RvLrp4tEQ5VyP1PCHjKBRSd4vJKpZ1bl6Lych4GrogqNWgaek g2vFa0zd6q/Gu++A3Ty24+RY4bEhivXZcRMWo3jOab4Q+H0JMzrd37zFvNAU1VkwfCsv zBuUtiBdHH6O/PaNFRjwg3MXcipdhg4Ns6exefgmmPo2gvXYgUUK30xGpmIUDH/EPF+E qvnih+EjiIwE8iBgQgd4o8n9fD/NIPRVKKJzRjMRJHIqHEe8FNlF4KaNha4Ftdwli7kB 046/RhxNB5YcmJud2lB/dZMIyQzI39txpawuuoMihUP0PLrmey1pHJkq6c0GtLBL+irK EtzA==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772549819; x=1773154619; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=oZ8k1ySLfcroRgtZoscW1jOJfSgryraPo7a7P5w2bg0=; b=kCpbWRGPt/Lz5kDShqdud//drrxy21GckwfxYkHfvJG/O12uXbo1EFXgtaE2TManru TA2mVMzPO/N9YN3s+mal94aOF+48Z9oqCDwFmIWH/ZBgDyShhMfOkuCXW4OC9Okzc7Em lFJhMQXd92fuXri84WScmCbxmn/1HwDtxUH+JC1gGhjPvBtH49iaOTXLUqeZaytZ/crw Iv3LYRNurmywtuHny7yR2DgLCVHkrYm7L24ffmVlFCoJDd9tNlOvf2N78gedbWIZkJUO qAlca51P3XPzOd8brwFbscVhkPRNb5b90FpcNhUreG27xAuWTBXRv3ivo65zHQMPs1Mh qZdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772549819; x=1773154619; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=oZ8k1ySLfcroRgtZoscW1jOJfSgryraPo7a7P5w2bg0=; b=WIdUhMbxquxYzEu5VqznWcSDv2fdyKj6AbCvjRJaGOZwK2DlY5sfmOKH3BaMSiPE5t VMlNxhpC6FXT3mmD/LBLvgv5Hx340969QRQP94qCxaazPOkz96Rb5tey8qjkAnFsVyhP IOoOau3uGrI4aSi/HUsfsLq6l+mVETOZ8A4JaeoGOENqIO60Un9L3quRxutmf4tAe1se 0QaNXlHS76NVtiKGkD3t/+nRuIcEB3Yk9FGnOMco/UXAm708j2I7Mc/dBLdGSH8Li75R aLh4iWJKSn20lGLWTDELm7kbeYiEPuWzMgOitYzo6SCUYT1GgnGfE4NbT+2c2PMq/OPD xUpA== X-Gm-Message-State: AOJu0YwDzlaYxPTUEhJi8Xy8bUAJQHl2XHKE6JPQaBrGPGV/dtZea1eH Dapnzngo3fW0tDWCSxirYlxYYLIeibgWHUbOvLM6BZ1S6QliiRHwGhgdpKOwhblhx0eH1qO/GxB f6udV87UHZU08f7s873CDShpV54B9fvo= X-Gm-Gg: ATEYQzznhAToLIGJSLC3y7v1KNmYGVgEqU8tnBA1QhzQPWLDG/sqZDQf8mj+K8FtP6M 6oRKKNZV1eR83ESYcKbzRK/NQpYUVbuuLtrFzeTed4iCz+DkzySOjRxKgsoWE1k5fQFK/gQO2f8 FSnq2GmCk0ElqRGOk6OLGRB0Ti8jNP3a7kM/aOOm/iQTvhkKZymz+UMmAaKM+rx6oneYmxQtqRp u/mMCA/8TCFamlRt92szjqcb20boFlrzaDySIIaorzX7psK4BgALv9LnOuGhvgxFPzthwkjPRkj lEI94IPaDQGwDR+o7g== X-Received: by 2002:a05:6820:4487:b0:66e:10ca:fcce with SMTP id 006d021491bc7-679fadbc012mr7942246eaf.3.1772549819048; Tue, 03 Mar 2026 06:56:59 -0800 (PST) MIME-Version: 1.0 References: <61063be9-abbc-4253-ac8e-2762c9997a24@eisentraut.org> In-Reply-To: <61063be9-abbc-4253-ac8e-2762c9997a24@eisentraut.org> From: Andrew Jackson Date: Tue, 3 Mar 2026 08:56:46 -0600 X-Gm-Features: AaiRm51RWFgws3ypr6dnOK8njrkJSrPae1oo0E8GKSUc9MUZF5YR-MTQewIdvx0 Message-ID: Subject: Re: Add Restart=on-failure To Example Systemd File To: Peter Eisentraut Cc: pgsql-docs@postgresql.org Content-Type: multipart/alternative; boundary="0000000000004faa35064c1feaae" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000004faa35064c1feaae Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Awesome, thank you. With regard to downstream package managers: I previously raised an issue with pgdg yum repos which was actioned [0]. The only other package manager that I use is nixpkgs, interestingly they set their service file's restart policy to "always"[1]. [0]: https://github.com/pgdg-packaging/pgdg-rpms/issues/127 [1]: https://github.com/NixOS/nixpkgs/blob/e510dca493787fb7dff8ad31c1f215a0e4d78= 00a/nixos/modules/services/databases/postgresql.nix#L802 On Tue, Mar 3, 2026, 6:22=E2=80=AFAM Peter Eisentraut wrote: > On 27.11.25 19:55, Andrew Jackson wrote: > > Currently the systemd file in the documentation does not specify a > > restart policy. By default systemd will not attempt to restart a > > service that has failed (killed by OOM-killer for example) [0]. The > > systemd docs recommends "Setting this to on-failure is the recommended > > choice for long-running services, in order to increase reliability by > > attempting automatic recovery from errors." I think that Postgres is > > probably a good example of a "long-running service". Pgbouncer for > > example also uses "Restart=3Don-failure" [1]. > > Committed. > > I think your argument from the commit message that most users copy their > systemd unit files from the docs is not quite correct. Most users use > what is in packages. So perhaps you want to check the usual packagings > and see if they are also using that setting. > > --0000000000004faa35064c1feaae Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Awesome, thank you.

With regard to downstream package managers:

I previously raised an issue with pgdg yum re= pos which was actioned [0]. The only other package manager that I use is ni= xpkgs, interestingly they set their service file's restart policy to &q= uot;always"[1].


On Tue, Mar 3, 2026, 6:22= =E2=80=AFAM Peter Eisentraut <peter@eisentraut.org> = wrote:
On 27.11.25 19:55, Andrew Ja= ckson wrote:
> Currently the systemd file in the documentation does not specify a
> restart policy. By default systemd will not attempt to restart a
> service that has failed (killed by OOM-killer for example) [0]. The > systemd docs recommends "Setting this to on-failure is the recomm= ended
> choice for long-running services, in order to increase reliability by<= br> > attempting automatic recovery from errors." I think that Postgres= is
> probably a good example of a "long-running service". Pgbounc= er for
> example also uses "Restart=3Don-failure" [1].

Committed.

I think your argument from the commit message that most users copy their systemd unit files from the docs is not quite correct.=C2=A0 Most users use=
what is in packages.=C2=A0 So perhaps you want to check the usual packaging= s
and see if they are also using that setting.

--0000000000004faa35064c1feaae--