Bug 1003695
Summary: | dhcpd dispatcher script for NetworkManager incorrect logic | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Dave Booth <limey.dave> |
Component: | dhcp | Assignee: | Jiri Popelka <jpopelka> |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | 19 | CC: | jpopelka, marchenko, thozza |
Target Milestone: | --- | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | dhcp-4.2.5-23.fc19 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2013-11-27 19:19:35 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Dave Booth
2013-09-02 19:24:13 UTC
Second issue: Apparent race condition between calling the dispatcher script and interface startup completing. Correct the logic to an OR pipeline and the service still fails to correctly restart, particularly at boot time. This script works =========== #!/bin/bash INTERFACE=$1 # The interface which is brought up or down STATUS=$2 # The new state of the interface # whenever interface is brought up by NM (rhbz #565921) if [ "$STATUS" = "up" ]; then # wait a few seconds to allow interface startup to complete # (important at boot time without this the service still fails # 2 seconds is too short, 5 seconds works - davebooth) sleep 5 # restart the services systemctl -q is-enabled dhcpd.service || systemctl restart dhcpd.service systemctl -q is-enabled dhcpd6.service || systemctl restart dhcpd6.service fi =========== (In reply to Dave Booth from comment #0) > "systemctl -q is-enabled..." returns 0 if the service is enabled, but this > logic is looking for a non-zero return status to trigger the restart. Strange, I've been always thinking that in 'command1 && command2' the command2 will be started in case command1 exits with 0 (because 0 return code means success). Trying systemctl is-enabled dhcpd.service && echo "it's enabled, restarting" and systemctl is-enabled dhcpd.service || echo "it's enabled, restarting" seems to confirm my belief. Can you check it once more ? (In reply to Dave Booth from comment #1) > if [ "$STATUS" = "up" ]; then > # wait a few seconds to allow interface startup to complete > # (important at boot time without this the service still fails > # 2 seconds is too short, 5 seconds works - davebooth) > sleep 5 This should be ok. Thanks. dhcp-4.2.5-21.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/dhcp-4.2.5-21.fc20 dhcp-4.2.5-21.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/FEDORA-2013-16621/dhcp-4.2.5-21.fc19 Package dhcp-4.2.5-21.fc20: * should fix your issue, * was pushed to the Fedora 20 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing dhcp-4.2.5-21.fc20' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2013-16955/dhcp-4.2.5-21.fc20 then log in and leave karma (feedback). dhcp-4.2.5-22.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/dhcp-4.2.5-22.fc20 dhcp-4.2.5-22.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report. (In reply to Dave Booth from comment #1) > if [ "$STATUS" = "up" ]; then > # wait a few seconds to allow interface startup to complete > # (important at boot time without this the service still fails > # 2 seconds is too short, 5 seconds works - davebooth) > sleep 5 Now I see in /var/log/messages: nm-dispatcher.action: Script '/etc/NetworkManager/dispatcher.d/12-dhcpd' took too long; killing it. NetworkManager[616]: <warn> Dispatcher script timed out: Script '/etc/NetworkManager/dispatcher.d/12-dhcpd' timed out. Looking at the NM code [1] I see that the time-out for dispatcher script is 3 seconds. So I tend to decrease the sleep to 2 or remove it at all, what do you think ? [1] http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/callouts/nm-dispatcher-action.c#n353 dhcp-4.2.5-23.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/dhcp-4.2.5-23.fc20 Package dhcp-4.2.5-23.fc19: * should fix your issue, * was pushed to the Fedora 19 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing dhcp-4.2.5-23.fc19' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2013-16621/dhcp-4.2.5-23.fc19 then log in and leave karma (feedback). dhcp-4.2.5-23.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report. dhcp-4.2.5-23.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report. Fedora 20, dhcp-4.2.5-26.fc20.i686 dhcpd won't start, I'm getting: Dispatcher script timed out: Script '/etc/NetworkManager/dispatcher.d/12-dhcpd I've tried to manually start it with systemctl start dhcpd.service and it just hangs there... ps ax does show systemctl restart dhcpd.service command running, but doesn't show dhcpd itself is being started. nothing useful in /var/log/* (In reply to Vlad from comment #13) > I've tried to manually start it with systemctl start dhcpd.service and it > just hangs there... Actually, it looks like the dispatcher script timed out because there's some problem with dhcpd. > ps ax does show systemctl restart dhcpd.service command running, but doesn't > show dhcpd itself is being started. nothing useful in /var/log/* Could you run it by hand with 'dhcpd -d' and post the output in a new bug, to not mess this one. Does 'setenforce 0' make any change ? Jiri - submitted new bug (#1035445), see dhcpd output there. selinux is disabled at startup. |