Github messages for voidlinux
 help / color / mirror / Atom feed
From: steinex <steinex@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] postgresql: allow for proper shutdown
Date: Mon, 18 May 2020 11:19:26 +0200	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-22075@inbox.vuxu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 865 bytes --]

There is a new pull request by steinex against master on the void-packages repository

https://github.com/steinex/void-packages postgresql
https://github.com/void-linux/void-packages/pull/22075

postgresql: allow for proper shutdown
runit sends TERM per default if it wants to down a service.
For postgres this means it will go into "smart shutdown mode" [1] and
wait until the last client disconnects and only then shut down. This
can lead to unproper termination of postgres, especially on
shutdowns/reboots.

This change overrides runits default beharviour by sending INT instead
so postgres will go into "fast shutdown mode" [1], which will make
postgres exit as promptly as possible.

[1] https://www.postgresql.org/docs/9.6/server-shutdown.html

cc @jnbr 

A patch file from https://github.com/void-linux/void-packages/pull/22075.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-postgresql-22075.patch --]
[-- Type: text/x-diff, Size: 1664 bytes --]

From a9672e42f6bfa062b833796719ba9e3a3a0a29b2 Mon Sep 17 00:00:00 2001
From: Frank Steinborn <steinex@nognu.de>
Date: Mon, 18 May 2020 11:09:53 +0200
Subject: [PATCH] postgresql: allow for proper shutdown

runit sends TERM per default if it wants to down a service.
For postgres this means it will go into "smart shutdown mode" [1] and
wait until the last client disconnects and only then shut down. This
can lead to unproper termination of postgres, especially on
shutdowns/reboots.

This change overrides runits default beharviour by sending INT instead
so postgres will go into "fast shutdown mode" [1], which will make
postgres exit as promptly as possible.

[1] https://www.postgresql.org/docs/9.6/server-shutdown.html
---
 srcpkgs/postgresql/files/postgresql/control/t | 2 ++
 srcpkgs/postgresql/template                   | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
 create mode 100755 srcpkgs/postgresql/files/postgresql/control/t

diff --git a/srcpkgs/postgresql/files/postgresql/control/t b/srcpkgs/postgresql/files/postgresql/control/t
new file mode 100755
index 00000000000..b0026e5661b
--- /dev/null
+++ b/srcpkgs/postgresql/files/postgresql/control/t
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/bin/kill -INT `/usr/bin/head -1 /run/runit/supervise.postgresql/pid`
diff --git a/srcpkgs/postgresql/template b/srcpkgs/postgresql/template
index 14ba9e7d50f..9e9db0bd68e 100644
--- a/srcpkgs/postgresql/template
+++ b/srcpkgs/postgresql/template
@@ -1,7 +1,7 @@
 # Template file for 'postgresql'
 pkgname=postgresql
 version=9.6.18
-revision=1
+revision=2
 build_style=gnu-configure
 make_build_target=world
 configure_args="--with-openssl --with-python

             reply	other threads:[~2020-05-18  9:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-18  9:19 steinex [this message]
2020-05-18 19:17 ` jnbr
2020-05-18 19:17 ` [PR PATCH] [Merged]: " jnbr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-22075@inbox.vuxu.org \
    --to=steinex@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).