Bug 479639
Summary: | dhclient uses expired lease after resume from suspend/hibernate | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Quentin Armitage <quentin> | ||||||||||
Component: | dhcp | Assignee: | David Cantrell <dcantrell> | ||||||||||
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||||||
Severity: | high | Docs Contact: | |||||||||||
Priority: | low | ||||||||||||
Version: | 11 | CC: | dcantrell, john47ab, jskala, opensource, pknirsch, quentin, richard, wwoods | ||||||||||
Target Milestone: | --- | ||||||||||||
Target Release: | --- | ||||||||||||
Hardware: | All | ||||||||||||
OS: | Linux | ||||||||||||
Whiteboard: | |||||||||||||
Fixed In Version: | 4.1.0p1-2.fc11 | Doc Type: | Bug Fix | ||||||||||
Doc Text: | Story Points: | --- | |||||||||||
Clone Of: | Environment: | ||||||||||||
Last Closed: | 2009-08-25 22:12:44 UTC | Type: | --- | ||||||||||
Regression: | --- | Mount Type: | --- | ||||||||||
Documentation: | --- | CRM: | |||||||||||
Verified Versions: | Category: | --- | |||||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||||||
Embargoed: | |||||||||||||
Attachments: |
|
Description
Quentin Armitage
2009-01-12 10:26:31 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle. Changing version to '11'. More information and reason for this action is here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping This sounds like a script that pm-utils needs to provide in /usr/lib[64]/pm-utils/sleep.d I'm going to create a script you can drop in /usr/lib[64]/pm-utils/sleep.d that should fix up the problem you are seeing. Can you try it out and report back whether or not it works? Created attachment 356265 [details]
56dhclient
Save this attachment and put it in your /usr/lib/pm-utils/sleep.d directory (or /usr/lib64/pm-utils/sleep.d if you are on a 64-bit platform). No other configuration should be necessary.
This script will down any dhclient-controlled interfaces that are not already controlled by NetworkManager. On resume, it will bring up only those interfaces that were downed for the suspend operation.
Created attachment 356455 [details]
56dhclient
Updated version of the script. Same instructions apply.
(In reply to comment #2) > This sounds like a script that pm-utils needs to provide in > /usr/lib[64]/pm-utils/sleep.d Please ship this script in dhclient. You don't need to depend on pm-utils for directory ownership, because the directory is owned by filesystem starting with Rawhide. So you can just drop the script there and if pm-utils is installed and used, the script will be used, too. Btw. instead of the huge sed script, you can use tr for better readability: tr ABCDEFHLNOPST abcdefhlnopst I have tested the script, and found that a few changes were necessary. Most are obvious, and I think the sed/tr change is only style. However, I found that /sbin/ip link show would show my wireless link (and also lo) in state UNKNOWN following booting the system, and so I have modified the script to work if the state is UNKNOWN as well as UP. In respect of the conversion from upper to lower case, when I tested the change to tr, I edited the "no" and "dhcp" strings in the ifcfg-eth1 script, so they were upper case, and in that state, the interfaces did not come up with ifup eth1. I therefore assume that the strings are required to be lower case in the ifcfg files, and so the tanslation may be superfluous anyway. Revised script, which works on my system, is attached. Created attachment 356499 [details]
Modified 56dhclient following testing
(In reply to comment #5) > (In reply to comment #2) > > This sounds like a script that pm-utils needs to provide in > > /usr/lib[64]/pm-utils/sleep.d > > Please ship this script in dhclient. You don't need to depend on pm-utils for > directory ownership, because the directory is owned by filesystem starting with > Rawhide. So you can just drop the script there and if pm-utils is installed and > used, the script will be used, too. Sounds good. I did an 'rpm -qf' on the other scripts in /usr/lib[64]/pm-utils/sleep.d and saw that pm-utils owns them. Or at least the ones I queried, so I assumed that's where it should go. > Btw. instead of the huge sed script, you can use tr for better readability: > tr ABCDEFHLNOPST abcdefhlnopst Yeah, I know of tr. I was unsure if the pm-utils scripts could rely on tools in /usr, especially if /usr is NFS mounted. That's why I went with the ugly sed script. (In reply to comment #6) > I have tested the script, and found that a few changes were necessary. Most are > obvious, and I think the sed/tr change is only style. However, I found that > /sbin/ip link show would show my wireless link (and also lo) in state UNKNOWN > following booting the system, and so I have modified the script to work if the > state is UNKNOWN as well as UP. > > In respect of the conversion from upper to lower case, when I tested the change > to tr, I edited the "no" and "dhcp" strings in the ifcfg-eth1 script, so they > were upper case, and in that state, the interfaces did not come up with ifup > eth1. I therefore assume that the strings are required to be lower case in the > ifcfg files, and so the tanslation may be superfluous anyway. > > Revised script, which works on my system, is attached. Thanks for testing it out and thanks for adding the UNKNOWN state handling too. Regarding the lowercase conversion, I think I might just drop that based on what you said. Thanks, guys. (In reply to comment #8) > Yeah, I know of tr. I was unsure if the pm-utils scripts could rely on tools > in /usr, especially if /usr is NFS mounted. That's why I went with the ugly > sed script. I am not sure if I am missing something like caching, but pm-utils and your script are already placed in /usr. (In reply to comment #10) > (In reply to comment #8) > > > Yeah, I know of tr. I was unsure if the pm-utils scripts could rely on tools > > in /usr, especially if /usr is NFS mounted. That's why I went with the ugly > > sed script. > > I am not sure if I am missing something like caching, but pm-utils and your > script are already placed in /usr. Oh right. I'm a moron. Well, based on the feedback from Quentin, I'm dropping the lowercase conversion anyway. Thanks. dhcp-4.1.0p1-2.fc11 has been submitted as an update for Fedora 11. http://admin.fedoraproject.org/updates/dhcp-4.1.0p1-2.fc11 dhcp-4.1.0p1-2.fc11 has been pushed to the Fedora 11 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update dhcp'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-8399 dhcp-4.1.0p1-2.fc11 has been pushed to the Fedora 11 stable repository. If problems still persist, please make note of it in this bug report. The actual 56dhclient script included in the release contains the following in resume_dhclient(): cd /etc/sysconfig/network-scripts while read device ; do /sbin/ifup ${DEVICE} done < ${PM_DHCLIENT_SUSPEND} where this should of course have DEVICE capitalised in the while read: cd /etc/sysconfig/network-scripts while read DEVICE ; do /sbin/ifup ${DEVICE} done < ${PM_DHCLIENT_SUSPEND} The effect of this bug is that the interface is not actually brought up again at all on resume - at least for me - and a usage message for ifup is logged. I realise that this fix is present in the attachments to this bug, but it's not in the file deployed by the RPM. Created attachment 360956 [details] Patch to dhcp.spec to install 56dhclient The effect of the problem identified in comment #15 is somewhat masked by 56dhclient not being installed. The attached patch corrects dhcp.spec so that 56dhclient is installed, rather than 10-dhclient being installed in two different locations. |