tech-pkg archive

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

Re: pkgin idea: warning about service restarts and database migrations



Thomas Klausner <wiz%NetBSD.org@localhost> writes:

> Since the list of packages that pkgin updates is sometimes really
> really long, I thought if we should add some heuristics to display
> notes about packages that an admin might want to know about.

I like this, especially if it helps reduce MESSAGE abuse.  But even if
not!

I would add "admin interaction required", for packages that need
handholding on update -- which is very usually an upstream bug, but
that's the world in which we live in.

> I was mostly thinking of servers that needed restarting, and databases
> that needed dumping before upgrades.
>
> For the servers, one heuristic I thought of is that these usually have
> rc.d scripts (or smf files).

Yes, but having an rc.d script and needing attention are different.  On
my desktop I have lots of things with scripts installed, some because I
want to use clients only (e.g. ups-nut), and some because I want to
build test them (e.g. matrix-synapse).  So it's really

  - installs an rc.d script
  - which is enabled in rc.conf

and that maybe can be determined by "/etc/rc.d/foo status" and seeing if
it is yes/no vs the error, and maybe spiffing up rc.d scripts to be able
to tell.  and of course a similar api for other init systems.

> For databases, I guess the easiest way is to combine this with a
> CATEGORY check on databases.

I don't think that's right.  Lots of things in that category do not need
manual handling.  postgresql, msyql micro updates for example.  sqlite3.
What needs handling is (or was) changing major versions of pgsql (and
probably mysql, but I was raised postgres so am unclear :-).

Thinking a bit more, I see this as a package-settable variable

  UPGRADE_ADMIN_ATTENTION
  (jsr pc,bikeshed_about_name)

which indicates that a mere upgrade of this package is going to require
the admin to think and deal.  This should be rare and I think it is.


There's another situation, which is that upgrading from foo 1 to foo 2
needs a dump/restore, and these might be different packages.  That could
have

  UPGRADE_PKGPATH_ADMIN_ATTENTION

to indicate that a pkgin rm/install across different PKGPATH entries
needs attention.   This could be triggered by SUPERCEDES eg xen-4.13 to
xen-4.15.

> As for the actual effect, pkgin could show a reminder when done
> updating, something like:
>
>
> --- begin quote ---
> The following packages which provide service have been updated:
>
>    list of packages
>
> You might want to restart the following service:
>
>    list of rc.d files

I do wonder if this should be an option to just do it, settable in a
config file.  And done via rcorder * and then restarting the ones on the
list.

I would prefer compact to avoid scrolling, so more like

  The following packages with enabled rc.d scripts have been updated;
  restarting them is likely appropriate::
    pkg1: pkg1_foo pkg1_bar
    pkg2: pkg2
    
> For the databases, perhaps a confirmation dialog could be added BEFORE
> updating, something like:
>
> --- begin quote ---
> The following database packages will be upgraded:
>
>    list of packages
>

> Please make sure you taken the necessary steps for migrating databases
> from the old to the new versions.
> --- end quote ---

I would prefer

  The following package,s which are marked to require manual sysadmin
  attention (e.g. for incompatible storage formats), will be upgraded:
    pkg3
    pkg4

  Please take the pre-upgrade steps (e.g. data dump/export).  Proceed
  with updates (yes/NO):

instead.



Home | Main Index | Thread Index | Old Index