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 1hT1iQ-0002wh-SS for pgsql-pkg-debian@arkaria.postgresql.org; Tue, 21 May 2019 10:09:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hT1iP-0004aF-Bt for pgsql-pkg-debian@arkaria.postgresql.org; Tue, 21 May 2019 10:09:49 +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 1hT1iP-0004Z8-0V for pgsql-pkg-debian@lists.postgresql.org; Tue, 21 May 2019 10:09:49 +0000 Received: from feynman.df7cb.de ([195.49.152.168]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hT1iK-0004Jg-Cr for pgsql-pkg-debian@lists.postgresql.org; Tue, 21 May 2019 10:09:47 +0000 Received: from msg.df7cb.de (unknown [IPv6:2003:5b:203b:100:7627:eaff:fe52:8e03]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by feynman.df7cb.de (Postfix) with ESMTPSA id 457Whj1zbWz3DyB; Tue, 21 May 2019 12:09:41 +0200 (CEST) Date: Tue, 21 May 2019 12:09:40 +0200 From: Christoph Berg To: =?iso-8859-1?Q?S=E9bastien_Lardi=E8re?= Cc: pgsql-pkg-debian@lists.postgresql.org Subject: Re: Upgrade packages - Control Instance Message-ID: <20190521100940.GC12440@msg.df7cb.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Re: Sébastien Lardière 2019-05-21 > Hi, > > I'm looking for a way to control the way instances are restarted when > `apt upgrade` run => sometime, if there is a large number of packages to > upgrade, the instances is stopped for a long time. > > In the past, I used to use start.conf with manual setting, then restart > "manually" after the upgrade, which give downtime as short as I can ; > but now, it seems that "stop" is always done, even when i disable the > systemd service (ok,it is weird to disable service and to want the > service up, I know ) => I think that the fact we can't forbid the stop > is not correct. > > I know that I can hold the postgresql packages, run the big `apt > upgrade` then unhold packages and do the postgresql upgrade, but I think > it's a more complicated way to do it. > > Am I miss something ? > > Am I the only one disturbed by the fact that we can't forbid stop ? The generic solution is policy-rc.d: https://people.debian.org/~hmh/invokerc.d-policyrc.d-specification.txt Simple sample implementation: #!/bin/sh # policy-rc.d script for chroots. # Copyright (c) 2007 Peter Palfrader test -f /etc/debian_chroot || exit 0 while true; do case "$1" in -*) shift ;; makedev) exit 0;; *) echo "Not running services in chroot." exit 101 ;; esac done Christoph