Bug 1279712

Summary: [dhcp]dhclient command return 0 even if the interface failed to get ip from server
Product: Red Hat Enterprise Linux 7 Reporter: haidong li <haili>
Component: dhcpAssignee: Jiri Popelka <jpopelka>
Status: CLOSED NOTABUG QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.2   
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-10 08:59:51 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 haidong li 2015-11-10 06:04:25 UTC
Description of problem:
dhclient  return 0 even if the interface failed to get ip from server

Version-Release number of selected component (if applicable):

[root@hp-dl385pg8-05 src]# uname -a
Linux hp-dl385pg8-05.rhts.eng.nay.redhat.com 3.10.0-327.el7.x86_64 #1 SMP Thu Oct 29 17:29:29 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux

How reproducible:
100%

Steps to Reproduce:

[root@hp-dl385pg8-05 src]# dhclient -v ens3f1.14
Internet Systems Consortium DHCP Client 4.2.5
Copyright 2004-2013 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/ens3f1.14/00:05:33:26:9e:5b
Sending on   LPF/ens3f1.14/00:05:33:26:9e:5b
Sending on   Socket/fallback
DHCPDISCOVER on ens3f1.14 to 255.255.255.255 port 67 interval 5 (xid=0x6a51c4d9)
DHCPDISCOVER on ens3f1.14 to 255.255.255.255 port 67 interval 14 (xid=0x6a51c4d9)
DHCPDISCOVER on ens3f1.14 to 255.255.255.255 port 67 interval 14 (xid=0x6a51c4d9)
DHCPDISCOVER on ens3f1.14 to 255.255.255.255 port 67 interval 10 (xid=0x6a51c4d9)
DHCPDISCOVER on ens3f1.14 to 255.255.255.255 port 67 interval 13 (xid=0x6a51c4d9)
DHCPDISCOVER on ens3f1.14 to 255.255.255.255 port 67 interval 5 (xid=0x6a51c4d9)
No DHCPOFFERS received.
No working leases in persistent database - sleeping.
[root@hp-dl385pg8-05 src]# echo $?
0
[root@hp-dl385pg8-05 src]# 


Actual results:

[root@hp-dl385pg8-05 src]# echo $?
0

Expected results:
[root@hp-dl385pg8-05 src]# echo $?
1

Additional info:

Comment 2 Jiri Popelka 2015-11-10 08:59:51 UTC
(In reply to haidong li from comment #0)
> No DHCPOFFERS received.
> No working leases in persistent database - sleeping.

Because it did not exit, it reverted to running into background.
You can use '-d' to make it run in foreground all the time.