[packagekit] Detecting when we need to restart the session

Richard Hughes hughsient at gmail.com
Tue Oct 14 08:32:20 PDT 2008


On Tue, 2008-10-14 at 10:29 -0400, James Antill wrote:
> On Tue, 2008-10-14 at 14:45 +0100, Richard Hughes wrote:
> > At the moment, a few of the backends send the RequireRestart signal to
> > client applications. The yum backend in particular gets the data from
> > bohdi, and then this data is used to advise the use they will need to
> > restart because of kernel updates and the like. Other backends may just
> > have blacklists, I'm not sure.
> > 
> > In the API, there's also the options of a session and application
> > restart. The former means a log out and log in, and the latter means
> > just restarting the application.
> > 
> > This probably isn't a backend thing, as if a program binary is modified
> > then we need to restart for the changes to be affected. This depends on
> > the binary actually running.
> 
>  Why does that make it not a backend thing? Why would we want different
> behaviour on updates from PackageKit vs. cmd line (or cron, or
> whatever)?

You want yum to say:
"You need to restart the running instance of openoffice-writer after
this update"?

Surely yum is the tool, and PK is the bit of fluff on top for the user
experience. All the backends would have to do the same thing as one
another, so I thought it made sense to move this higher up.

>  The other problem is that Linux is multi-user and with fast user
> switching etc. it's fairly easy for the user installing the updates with
> the GUI to not be the only user on a desktop on the machine.

Sure, the RequireRestart is send as an enum to all sessions, so it's
propagated and translated correctly on multiuser computers.

>  Ideally IMO this should be in the packages, in the same way
> bind/apache-httpd does service condrestart ... firefox/openoffice could
> do a similar thing.

Ohh, I'm not actually restarting the binary -- I'm just warning the user
that they need to restart the session to get the effect of the updates
they just did. Maybe we should only use this heuristic if the update is
a security update.

> > The attached patch queries the backend for the file lists of the updated
> > packages, and then checks to see if any executable files of that name
> > are in use. If so, it send a session restart signal.
> 
>  Also I've seen firefox lose data you've typed into a form on session
> restart, which is another good reason to make this opt in per. package
> IMO.

Sure, see above. The restarting has to be done by the user, as it may be
a _really_ bad time.

Thanks,

Richard.





More information about the PackageKit mailing list