pg.ddx.io  pgsql-pkg-debian@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christoph Berg <myon@debian.org>
To: Sébastien Lardière <sebastien@lardiere.net>
Cc: pgsql-pkg-debian@lists.postgresql.org
Subject: Re: Upgrade packages - Control Instance
Date: Tue, 21 May 2019 12:09:40 +0200
Message-ID: <20190521100940.GC12440@msg.df7cb.de> (raw)
In-Reply-To: <f4efadb7-ecb0-ba1f-383b-b9a38f988f87@lardiere.net>
References: <f4efadb7-ecb0-ba1f-383b-b9a38f988f87@lardiere.net>

Re: Sébastien Lardière 2019-05-21 <f4efadb7-ecb0-ba1f-383b-b9a38f988f87@lardiere.net>
> 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 <peter@palfrader.org>

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





view thread (3+ messages)  latest in thread

Message-ID: <20190521100940.GC12440@msg.df7cb.de>
Permalink:  ../20190521100940.GC12440@msg.df7cb.de/
Also on:    postgresql.org/message-id/20190521100940.GC12440@msg.df7cb.de

 · 

reply

Reply instructions:

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

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-pkg-debian@postgresql.org
  Cc: myon@debian.org, sebastien@lardiere.net
  Subject: Re: Upgrade packages - Control Instance
  In-Reply-To: <20190521100940.GC12440@msg.df7cb.de>
  References: <f4efadb7-ecb0-ba1f-383b-b9a38f988f87@lardiere.net> <20190521100940.GC12440@msg.df7cb.de>

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

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox