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

Re: Get list of restarted services during upgrade



Denis Witt wrote:
> I'm running a Cluster that has to be set in Maintenance-Mode if
> monitored services are restarted.

I assume from this that services are being monitored.  If they are
restarted and during the restart the monitoring detects that the
service is offline then it triggers an alert.  And whatever the
setting of "Maintenance-Mode" does basically tells the monitoring to
ignore any problem for that time period.  Is that about right?

> I want to do this only if needed, so I need to know which services
> will be restarted during upgrade/installation. You can't always see
> that, even if you runs interactive mode. An example is the
> installation of phpmyadmin, it will restart Apache, but it's hard to
> spot from the package names.

I see the problem for you now.  Because various packages such as
phpmyadmin will run the restarts in the postinst scripts.  Therefore
in order to really determine what would be restarted it would be
necessary to walk through the postinst scripts.  And that is an open
ended basically practically impossible problem.

I do not know of a way to do this "only when needed".  The first
thought I had was to always put the node into maintenance-mode before
the upgrade, run the upgrade, then return it afterward.  Is there a
downside to doing it that way?  With only this quick look that is the
best I can think of at this moment.  Perhaps another reader will have
a better thought here.  I couldn't think of anything.

> At the moment I try out update-rc.d to avoid any service to be
> restarted during upgrade, but I wonder if there might be a better
> solution.
> ...
> It's policy-rc.d, of course, not update-rc.

That is an idea.  Every use of a postinst script to restart a daemon
should be gated by policy-rc.d.  And you could always approve the
restart but that script could at that time put the node into your
maintenance-mode right then.  Don't know what you would use to return
it to regular service afterward.  Perhaps after a timeout.

Note that I (on this mailing list) learned recently that while
policy-rc.d does gate all uses of postinst it does nothing at boot
time.  I think that is a hole in the feature set.  During boot time
the daemon is started regardless of any policy-rc.d configuration.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: