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

Re: long daemon outages on upgrade



On Wed, Mar 13, 2002 at 02:54:21PM -0500, Branden Robinson wrote:
> On Wed, Mar 13, 2002 at 04:54:37PM +0000, Mark Brown wrote:
> > On Wed, Mar 13, 2002 at 09:59:16AM -0600, Adam Heath wrote:

> > > The real problem, imho, is that apt leaves things in the unpacked and
> > > unconfigured state too long.  I see no problem, with it doing partial
> > > configures.

> > > Ie, during an upgrade, when there are X number of unconfigured packages, go
> > > and do a configure run.  However, the apt author doesn't want to do this, and
> > > has given no good reason as to why.

> > Another approach which has been suggested is that packages that
> > shouldn't be left unconfigured for too long could be tagged by the admin
> > (perhaps also in the packages file) and then upgraded and configured
> > individually.

> > The suggested workaround for now is to do this by hand.

> Why don't we just write our maintainer scripts like this?:

> * In the package prerm script:
> 	case "$1" in
> 	upgrade|failed-upgrade)
> 		# don't stop the daemon
> 		;;
> 	remove|deconfigure)
> 		# /etc/init.d/daemon stop
> 		;;
> 	esac

> * In the package postinst script:
> 	/etc/init.d/daemon restart

> As long as the init script is written such that it's not an error when
> you try to stop a daemon that isn't running (IMO, that should not be an
> error), I can't think of why the above wouldn't work.

If the init script depends on the --exec feature of start-stop-daemon to find
the right process (because the daemon doesn't create a pid file), won't
calling /etc/init.d/daemon restart have a hard time doing the right thing?
Also, I've been on the receiving end of bug reports asking that daemons not
be automatically started on upgrade unless they're already running, on the
grounds that if it wasn't running it's because the daemon doesn't /want/ it
running.  A Total Solution should take both of these issues into account.

Granted, these are not insurmountable problems.  The real problem is that we
have hundreds of packages in Debian that provide daemons, and there hasn't
really been much coordination among maintainers of said packages to find a
common solution to the restart question.  Instead, maintainers have mostly
been left to debug their own scripts as problems arise, resulting in quite
inconsistent behavior.

Steve Langasek
postmodern programmer

Attachment: pgpvM68jeqT1G.pgp
Description: PGP signature


Reply to: