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

Re: Checking if another package is upgraded at the same time



On Wed, Mar 22, 2006 at 06:08:13PM -0500, Justin Pryzby wrote:
> On Thu, Mar 23, 2006 at 12:11:59AM +0200, Kari Pahula wrote:
> > problems.  The server runs as a daemon and will be more or less at an
> > inconsistent state if the maps are upgraded while it is running.
> So you want to have a one-way dependency (since you can have -maps
> installed without "causing problems").  -server should depend on
> -maps, perhaps (>=X-1), (<<[X+1]-1).  The trailing -1 is the debian
> version, not a subtraction, but the [X+1] is subtraction:
> 
> Depends: crossfire-maps (>=0.95.3), crossfire-maps (<<0.96)

The problem with this is that there's a second set of maps too,
crossfire-maps-small.

Other than that this is an ugly hack, since the dependency is not real
but only in there to cause server restarts.

> > Restarting the server needs to be done when upgrading crossfire-maps.
> > But having one package to automatically cause another to run
> > /etc/init.d/foo restart is certain to surprise a number of users.
> > Using debconf to ask whether to abort install, install and restart or
> > just install sounds like a good idea to me.
> Overuse of debconf is discouraged; check the dict-bouvier and
> gazetterer packages for examples one one package restarting another
> packages daemon.

Both of those restart the server silently.  Restarting
crossfire-server will cause any remote players to have their
connection abrubtly broken and to lose any progress that they've had
since their logon.  That's not quite what I'd call a smooth upgrade.
Is it reasonable to expect users to expect this behavior on upgrading
the maps?  Would it be enough to put in crossfire-maps description
that upgrading maps will cause the server to restart?

At least I think I can safely assume that users will know to expect
that upgrading the crossfire-server package itself to cause the server
to restart.

> > is upgraded on the same run.  Is there any reliable way to check if
> > the server is being upgraded in crossfire-maps' preinst?
> I think this is probably one of the questions that is indicitive of
> doing stuff the wrong way :)

I wish that there were some way to say that an another package has to
be fully installed before configuring a package, but only if that
another package is to be installed at all.  Pre-depends does half of
that, but I'd like to drop the depends-part of what it does.

Then I could simply check with netstat if clients are still connected
to the server and give the user options about what to do in that case,
instead of just silently restarting the server.  The chances are that
after a server restart any players haven't yet connected when the maps
are to be installed and I get away with not asking that question.

But even that might be a bit too complicated way to approach this.
Nothing's worse than software that tries to be too intelligent.

It seems to me that adding a warning to crossfire-maps' description
and then silently restarting server in its postinst might be the best
course of action.

Attachment: signature.asc
Description: Digital signature


Reply to: