[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Reducing downtime on system critical services

On Mon, Apr 03, 2000 at 09:11:30PM +0300, ressu@uusikaupunki.fi wrote:
> once again, i was upgrading a system, and got MANY angry calls about
> 'mails not working'. wouldn't it be good to have a list, flag or some
> other way of marking these system critical packages, so that apt would
> configure other packages before it, install it and configure it. so
> that it would have a minimum downtime.

i've done the same thing on my mail servers in the past. i avoid it now
by only upgrading postfix and cucipop and other mail-related packages

how would it be possible to flag these packages, when different packages
are important to different people? e.g. sendmail is important to you,
but irrelevant to me because i don't use it. and even on different
systems, different packages are important - on my mail server, i don't
want postfix down for ages - but i don't care how long it is down on
my web server or proxy server....while on my proxy server, squid is
important, and on my web servers, apache and/or postgres is important.

what you want can be achieved by making the packages "Held", i.e.
preventing them from being automatically upgraded.

> on a 486 with 8Mb of mem, it's a bit of a pain to upgrade, when the
> installation process itself takes many hours to complete. (i had
> sendmail down all that time) even though not many have these kind of
> old machines running anymore, it would still be wise to have packages
> like sendmail, and others which are needed on specific systems down as
> little time as possible, to avoid this kind of anger.

if you know that certain packages are crucial, and that you need to
minimise downtime then you should install them manually with 'dpkg -i
package' or 'apt-get install package'


    apt-get update
    apt-get install sendmail cucipop
    dpkg-hold sendmail cucipop      (note: not a standard script, see below)
    apt-get dist-upgrade            (or apt-get dselect-upgrade)

---cut here---
#! /bin/bash

# dpkg-hold  --  command line tool to flag package(s) as held.
# by Craig Sanders, 1998-10-26.  This script is hereby placed into the 
# public domain.
# BUGS: this script has absolutely no error checking.  this is not good.

if [ -z "$*" ] ; then
    echo "Usage:"
    echo "      dpkg-hold <package...>"
    exit 1

for i in $@ ; do
    echo "$i    hold"
done | dpkg --set-selections
---cut here---

> The best way for this might be a local list of packages that are
> important, and apt would read this list when beginning update/upgrade
> and deal with the packages accordingly, (as in deconfiguring,
> installing and configuring the package in as short time as possible)

it wouldn't be very difficult to write your own wrapper around apt-get
and dpkg-hold to do exactly this. personally, i find it pretty easy to
remember which packages i have to upgrade manually for minimum downtime.

such a wrapper could be based on the following:

    #! /bin/bash

    PACKAGES=$(cat /etc/apt/manual-upgrades)

    apt-get update

    apt-get install $PACKAGES
    # alternative:
    # for i in $PACKAGES; do
    #     apt-get install $i 
    # done

    dpkg-hold $PACKAGES

    apt-get dist-upgrade 

so, instead of running "apt-get dist-upgrade", you run
/usr/local/bin/myupgrade.sh (or whatever you want to call it). easy.


craig sanders

Reply to: