wicd-1.7.1 causes stdin error on dhclient

Bug #950865 reported by Alex Domingo on 2012-03-09
This bug affects 4 people
Affects Status Importance Assigned to Milestone

Bug Description

System: Gentoo Linux (amd64) with wicd-1.7.1 and dhcp-4.2.3.

Using wicd-1.7.1 with dhclient (as only DHCP client available on my system) doesn't work either for wired connections or wireless connections. On the simplest scenario, wired connection to a DHCP router on my lan with nothing fancy, a wire on eth0 and automatic dhcp connection, an error "could not get an IP address" is reported on the GTK interface.

However, on the log, dhclient reports an error on reading the stdin:

=======Part of wicd.log============
Internet Systems Consortium DHCP Client 4.2.3-P1 Gentoo-r0
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

failed to read stdin!

This version of ISC DHCP is based on the release available
on ftp.isc.org. Features have been added and other changes
have been made to the base software release in order to make
it work better with this distribution.

Please report for this software via the Gentoo Bugzilla site:

DHCP connection failed
exiting connection thread
Sending connection attempt result dhcp_failed

A bug on dhclient itself is discarded as it works flawslessly from the command line. Running "dhclient eth0" just works. Therefore, I looked into the wicd side trying to figure out the source of the problem.

The call to dhclient is done in the misc.Run function, located in wicd/misc.py using Popen
143: try:
144: f = Popen(cmd, shell=False, stdout=PIPE, stdin=std_in, stderr=err,
145: close_fds=fds, cwd='/', env=tmpenv)

There, the stdin argument depends on the std_in variable, which is set based on the value of return_obj in wicd/misc.py
132: if return_obj:
133: std_in = PIPE
134: else:
135: std_in = None

The call to misc.Run for dhclient sets return_obj=True and, therefore, the stdin argument is set to PIPE in Popen. Somehow the PIPE object is causing dhclient to fail in my system with the mentioned error about reading the stdin.
I fixed this problem in my system by changing, in the Popen call, the stdin argument to stdin=None, now dhclient is working and I can connect to both wired and wireless networks. But I don't know if this is the proper fix.

Related branches

Alex Domingo (lexmingor) wrote :

This bug still applies to wicd-

Same problem with wicd- on Gentoo Linux (amd64)

Zak Estrada (zestrada) wrote :

This is still an issue with wicd 1.7.3 (bzr-r933) on Gentoo Linux.
Editing the Run method in misc.py as follows fixes it:
    if return_obj:
        std_in = PIPE
        std_in = None
    std_in = None

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers