Restarting desktop session services on RPM upgrade?

Christopher Aillon caillon at redhat.com
Fri Jun 15 21:23:02 UTC 2007


Owen Taylor wrote:
> On Fri, 2007-06-15 at 11:44 -0400, Havoc Pennington wrote:
>> The Mugshot client daemon does this itself by installing a file called 
>> "version" with the package version, and if said file changes it restarts 
>> itself.
>> 
>> The version file doesn't have the RPM release in it, but presumably could.
>> 
>> An advantage of this approach is that it doesn't require magic in the 
>> spec file, though presumably it has downsides too. One downside is that 
>> the restart can be a bit too early (before the upgrade is complete).
> 
> We changed a while ago so Mugshot no longer installs the version file as
> a normal file .. instead it's %ghost and the end of the %post does:
> 
>   echo %{version} > %{_datadir}/mugshot/version
> 
> Now, there are still a downside: you have to wake up to check for an
> upgrade every so often. If you wake up too often, you drain power.
> If you wake up less often, it might be a while before you switch
> versions, so the desktop component needs to be robust against that.
> 
> (Doesn't try to read a file that gets removed in the newer version, say)
> 
> For Mugshot, we know when we've told the user to go get a new version,
> so we check more frequently for a while after that.

I have actually been wanting to do this for Firefox, as the 
/usr/lib/firefox-x.y directory changes.  I've pondered having the 
%postun script check to check $1 == 1 or something to see if it was an 
upgrade, and if so call dbus-send to firefox on the system bus (which 
firefox would listen to) to load a webpage telling the user they need to 
restart the browser.




More information about the Fedora-maintainers mailing list