Red Hat Bugzilla – Bug 437808
script should call "yum clean expire-cache" when network changes
Last modified: 2008-10-09 17:36:14 EDT
March 18th+ rawhide should have a new yum with this option:
yum clean expire-cache
This option forces yum to check for a new mirrorlist and repomd.xml the next
time it runs. The normal mirrorlist expiry time is 24 hours, which can be far
too long for people who roam between networks. NetworkManager knows when you
have switched to a different network, so it can easily tell yum to re-check the
mirrorlist the next time it runs.
You might want to fork "yum clean expire-cache", do not wait for it to finish,
and throw away the return value and stdout/stderr.
Dan said perhaps this could be done in a NetwortManagerDispatcher script,
although the service might not be running. Another possibility is to launch it
via dbus with an upstart event, but we are not sure if that is possible.
Upstart will be able to do this in F10, when 0.5 comes out. At the moment dbus
support isn't quite ready.
Not any NM thing really; but should be handled by the app/package that updates
packages. Either by a dispatcher script, or by upstart. Either way, it's the
apps responsibility to hook into network notifications either through a
dispatcher script, or upstart. Punting to yum.
we're not tying ourselves into NM and dbus just to facilitate an edge case.
Warren, if you want yum to do this before every call, write a plugin.
seth; there would be no tying to NetworkManager _or_ to dbus. Simply a file
placed by the package in /etc/NetworkManager/dispatcher.d, that accepts the
$1 - interface
$2 - action (either "up" or "down")
So, if the script were called by the dispatcher daemon with:
$2 == "up"
it would execute the cache cleanup stuff. Just a simple _shellscript_. No
dependency on dbus, no dependency on NM. If NM is not installed, nothing
executes the script.
For example, the simplest script might be:
[ "$2" = "up" ] && yum clean expire-cache 2>&1 > /dev/null
I presume you'd want to filter out the lo iface?
Do you need to filter stuff like:
inet6 addr: fe80::219:d1ff:fe7a:58ff/64 Scope:Link
...for boot up?
Warren, can you package that as a yum-NM-dispatcher or something?
According to dcbw, the lo interface is never sent to dispatcher. You see otherwise?
I will test to be sure a script works for everybody, I'll get back to you.
You seriously want an entire RPM package for only a two line shell script?
Yes, that way we can test it outside of yum itself.
And argue for it being in Base or just an extra package people can install,
getting around the whole "find 10 people it will help" problem.
Obviously if it tests out well, and people want it on by default it's then a
much easier argument to just ship it within yum itself.
We've gone a similar route for a lot of the yum features, doing them as plugins
distributed as a sub-package in yum-utils, so we don't have to go through the
package review pain in Fedora, and indeed you could ask Tim if he doesn't mind
doing the same for this.
This shell script is absolutely harmless and exceedingly simple. I will do it,
but I must strongly protest putting it into its own package. And this WILL be
installed by default in Fedora 9 one way or another.
Warren, i have no problem to host the script as a sub-package in yum utils, if
you do the script and a patch to Makefile & yum-utils.spec, then i will added
it, if nobody have any hard objections.
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
Is this absolutely harmless and exceedingly simple script still missing?
I added it.
yum-utils-1.1.16-1.fc9 has been submitted as an update for Fedora 9.
yum-utils-1.1.16-1.fc8 has been submitted as an update for Fedora 8.
yum-utils-1.1.16-1.fc9 has been pushed to the Fedora 9 stable repository. If problems still persist, please make note of it in this bug report.
yum-utils-1.1.16-2.fc8 has been submitted as an update for Fedora 8.
yum-utils-1.1.17-1.fc8 has been submitted as an update for Fedora 8.
yum-utils-1.1.17-1.fc9 has been submitted as an update for Fedora 9.
yum-utils-1.1.17-1.fc9 has been pushed to the Fedora 9 stable repository. If problems still persist, please make note of it in this bug report.
yum-utils-1.1.17-1.fc8 has been pushed to the Fedora 8 stable repository. If problems still persist, please make note of it in this bug report.