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

Re: Daemons and stoppages during upgrades.



On Sat, Oct 23, 1999 at 05:48:27PM -0600, Jason Gunthorpe wrote:
> On Sat, 23 Oct 1999, Erick Kinnee wrote:
> 
> > I propose that we develop some sort of method to tag daemon packages as
> > such. This way apt/dpkg could know to stop them and unpack and configure
> > them ahead of all other packages if possible. This way during large
> > updates web/mail/ftp and other services are not stopped for very long.
> > Maybe this could be "Daemon: yes" in the control file...
> 
> If you stick Important: yes with the packages then APT will do just that.
> More specifically you can add lines like
> 
> Package: sendmail
> Important: yes
> 
> To /var/state/apt/userstatus (?) and APT will will follow your directions.

this is a very useful thing to know.


in the long run, i think that the situation described (i.e. sendmail
being stopped during an upgrade) just highlights the need for the local
sysadmin to be aware of what is essential or important on their own
machines. the truth is that just about every package could be classified
as Important by some people and irrelevant by others (or even the same
people, for different machines).

this basically means that packages which are very important for a
particular server should be upgraded individually, and not as part of a
bulk dselect or apt-get upgrade. e.g. on a proxy server, upgrade squid
with 'apt-get install squid' before doing a full upgrade. ditto for
sendmail/exim/postfix/smail or whatever on a mail server. and ditto for
other packages which provide vital services.

automation is useful, but it is a tool to be used by an informed and
alert system admin...not a replacement for one.

as soon as the important package(s) are upgraded, the safest thing to do
is to immediately put them on hold to avoid any accidental upgrade in
future. the dpkg-hold script at the bottom of this message is a useful
tool for doing this.

also, the apache package and various libapache-* packages handle
upgrades particularly well - stopping and restarting the httpd in the
postinst when required. where appropriate, other daemon packages could
or should do the same...apache provides an excellent example of smoothly
managing the upgrade of an important daemon package.



---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
fi

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


craig

--
craig sanders


Reply to: