Bug 437808 - script should call "yum clean expire-cache" when network changes
script should call "yum clean expire-cache" when network changes
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
9
All Linux
low Severity low
: ---
: ---
Assigned To: Warren Togami
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-03-17 11:17 EDT by Warren Togami
Modified: 2008-10-09 17:36 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-08-07 14:45:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Warren Togami 2008-03-17 11:17:11 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.
Comment 1 Warren Togami 2008-03-17 13:45:55 EDT
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.
Comment 2 Casey Dahlin 2008-03-17 15:05:23 EDT
Upstart will be able to do this in F10, when 0.5 comes out. At the moment dbus
support isn't quite ready.
Comment 3 Dan Williams 2008-03-17 16:31:21 EDT
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.
Comment 4 Seth Vidal 2008-03-17 16:55:06 EDT
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.
Comment 5 Dan Williams 2008-03-17 17:31:18 EDT
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
following arguments:

$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.
Comment 6 Warren Togami 2008-03-17 17:53:48 EDT
For example, the simplest script might be:
#!/bin/bash
[ "$2" = "up" ] && yum clean expire-cache 2>&1 > /dev/null

Comment 7 James Antill 2008-03-17 18:06:01 EDT
 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?
Comment 8 Warren Togami 2008-03-17 22:37:09 EDT
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?
Comment 9 James Antill 2008-03-17 23:21:21 EDT
 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.
Comment 10 Warren Togami 2008-03-17 23:41:22 EDT
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.
Comment 11 Tim Lauridsen 2008-03-20 07:20:21 EDT
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. 
Comment 12 Bug Zapper 2008-05-14 02:39:40 EDT
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 13 Florian Festi 2008-05-30 09:46:42 EDT
Is this absolutely harmless and exceedingly simple script still missing?
Comment 14 James Antill 2008-08-07 14:45:27 EDT
 I added it.
Comment 15 Fedora Update System 2008-08-28 01:14:04 EDT
yum-utils-1.1.16-1.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/yum-utils-1.1.16-1.fc9
Comment 16 Fedora Update System 2008-08-28 01:19:27 EDT
yum-utils-1.1.16-1.fc8 has been submitted as an update for Fedora 8.
http://admin.fedoraproject.org/updates/yum-utils-1.1.16-1.fc8
Comment 17 Fedora Update System 2008-09-10 03:14:02 EDT
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.
Comment 18 Fedora Update System 2008-09-10 09:48:01 EDT
yum-utils-1.1.16-2.fc8 has been submitted as an update for Fedora 8.
http://admin.fedoraproject.org/updates/yum-utils-1.1.16-2.fc8
Comment 19 Fedora Update System 2008-09-12 01:13:36 EDT
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.
Comment 20 Fedora Update System 2008-09-18 03:41:24 EDT
yum-utils-1.1.17-1.fc8 has been submitted as an update for Fedora 8.
http://admin.fedoraproject.org/updates/yum-utils-1.1.17-1.fc8
Comment 21 Fedora Update System 2008-09-18 03:41:31 EDT
yum-utils-1.1.17-1.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/yum-utils-1.1.17-1.fc9
Comment 22 Fedora Update System 2008-10-09 17:28:04 EDT
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.
Comment 23 Fedora Update System 2008-10-09 17:36:14 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.