[Bug 732910] New: dhclient does not work with "ifup"
https://bugzilla.novell.com/show_bug.cgi?id=732910 https://bugzilla.novell.com/show_bug.cgi?id=732910#c0 Summary: dhclient does not work with "ifup" Classification: openSUSE Product: openSUSE 12.1 Version: Final Platform: x86-64 OS/Version: SuSE Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: nrickert@ameritech.net QAContact: qa@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20100101 Firefox/8.0 On reboot, there was no network (other than 127.0.0.1) I had set DHCLIENT_BIN to "dhclient Switching to NetworkManager got me a network. Then, switching DHCLIENT_BIN back to the default (empty string, implies dhcpcd), restored correct behavior. Here are some log messages from an unsuccessful boot: Nov 26 23:48:25 nwr2 dhclient: execve (/sbin/dhclient-script, ...): Exec format error Nov 26 23:48:26 nwr2 avahi-daemon[1284]: Registering new address record for fe80 ::21a:a0ff:fe20:4cdd on eth0.*. Nov 26 23:48:26 nwr2 ifup-dhcp: . The first of those probably points to the problem. Indeed, /sbin/dhclient-script is not appropriate for use with exec Reproducible: Always Steps to Reproduce: 1. 2. 3. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c1
Eduard Goiu
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c2
Martin Tessun
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c
Andreas Jaeger
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c3
Marius Tomaschewski
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c4
--- Comment #4 from Martin Tessun
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c5
--- Comment #5 from Frederic Crozat
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c6
--- Comment #6 from Neil Rickert
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c7
--- Comment #7 from Martin Tessun
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c8
--- Comment #8 from Martin Tessun
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c9
--- Comment #9 from Martin Tessun
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c10
--- Comment #10 from Martin Tessun
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c11
--- Comment #11 from Marius Tomaschewski
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c12
--- Comment #12 from Marius Tomaschewski
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c13
Ludwig Nussel
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c14
Neil Rickert
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c15
--- Comment #15 from Martin Tessun
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c16
--- Comment #16 from Neil Rickert
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c17
--- Comment #17 from Martin Tessun
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c18
--- Comment #18 from Martin Tessun
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c19
Marius Tomaschewski
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c20
--- Comment #20 from Neil Rickert
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c21
--- Comment #21 from Neil Rickert
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c22
--- Comment #22 from Marius Tomaschewski
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c23
--- Comment #23 from Neil Rickert
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c24
Phil Bertin
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c25
--- Comment #25 from Martin Tessun
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c26
--- Comment #26 from Neil Rickert
The culprit so HAS to be the /sbin/dhclient6.
We cannot rule out a kernel bug. Unless I am misreading, there is a kernel bug there somewhere. I added some debugging, as mentioned in comment 23. So when the lease renewed this afternoon, I check for the debug data. It was nowhere to be seen. As I read dhclient-script: my debugging data should be appended to the end of the log file. then some asterisks and a timestamp should be appended (around line 40 of dhclient-script). And then stderr from running the script should be appended to the log file (the "exec >>2" statement a few lines down). But when I look at the logfile, the first thing I see is that "redirected to systemctl" line. So the output from the last of those steps has truncated the log file, instead of appending to the end. I have not yet tested. I am guessing that: echo string > /dev/stderr is what is truncating the log file. I would think that is a kernel bug. "/dev/stderr" is a symlink to "/dev/fd/2, and file descriptor 2 is open for append. I admittedly am not certain of the definition of "/dev/fd/n" but it seems strange for that to be able to truncate a file when the file descriptor is open for append. If that's not a kernel bug, then the line in "/etc/rc.status" that writes to "/dev/stderr" should be using ">>" rather than ">". I'm not ruling out a bug in dhclient. There seems be room here for multiple bugs. It's possible that there's a bug in "dhclient" that has been there for a long time, but not actually triggered until that "/etc/rc.status" line wrote to stderr with the move to systemd. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c27
--- Comment #27 from Neil Rickert
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c28
--- Comment #28 from Neil Rickert
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c29
Marius Tomaschewski
I'm not ruling out a bug in dhclient. There seems be room here for multiple bugs. It's possible that there's a bug in "dhclient" that has been there for a long time, but not actually triggered until that "/etc/rc.status" line wrote to stderr with the move to systemd.
Yes, I do not rule out any bug in whatever, kernel, dhclient or one of its patches. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c30
--- Comment #30 from Phil Bertin
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c31
--- Comment #31 from Ludwig Nussel
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c32
--- Comment #32 from Neil Rickert
I think I found the error. (from comment 30) No, that's not the error. It is a temporary workaround.
Sorry, but it will be another day before I get the "lsof" output mentioned in comment 23. My first attempt at that failed, as reported in comment 26. Since then, I have rebooted (for entirely unrelated reasons). I do have the "lsof" output from the initial run of dhclient (acquiring the lease), but I don't yet have it for a lease renewal. For aquiring a lease, fd 2 is open to "/dev/null", which ought to be fine. But then I was never having dhclient problems on the initial lease. They only showed up for me on renewals. When I do get the "lsof" output, here is what I am expecting to see: Either: fd 2 is open for read only to the script file, or: fd 2 is not open at all (was inadvertantly closed). If my guess is right, then this is all related to what I have been calling a kernel bug in comments 26-28. The reason for this expectation: It is inconceivable to me that the "dhclient" binary would open "dhclient-script" for append - that's not the kind of mistake that programmers would make. It cannot be opening it for write, as that would truncate the file even if nothing is written to stderr. So it looks to me as if there is something funky about the implementation of "/dev/fd/n" which allows echo string > /dev/stderr to write to the file even when the stderr file descriptor is not open for output. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c33
--- Comment #33 from Phil Bertin
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c34
--- Comment #34 from Phil Bertin
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c35
--- Comment #35 from Neil Rickert
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c36
--- Comment #36 from Neil Rickert
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c37
--- Comment #37 from Phil Bertin
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c38
--- Comment #38 from Neil Rickert
There is "an" error in the execve- call, as the "execve ..." message wouldn't otherwise be reflected in the logs.
The only logs I am seeing of execve problems, are after dhclient-script has been corrupted. Here's my most recent such message: Dec 18 08:30:24 nwr2 dhclient: execve (/sbin/dhclient-script, ...): Exec format error I have rebooted and had lease renewals since then, with no such messages. But that's DEBUG turned on, which acts as a workaround to prevent corruption. Hmm, there's a thought. I expect the next lease renewal this evening. So I will deliberately sabotage dhclient-script to force that "log_error" call. If the error is logged, then stderr is still open at that point in the child process, so we are looking for a "close on exec" problem. If the error is not logged, then stderr has already been inappropriately closed. Looking at the main dhclient process with "lsof", the lease file is open with fd=4 Hmm, maybe it's just me. But that "fclose(leaseFile)" looks like poor logic to me. I think it is better to use close(fileno(leaseFile)); If there is unwritten buffered data, and you fclose() in the child process it will be written then and later written again in the parent process. Just closing the file descriptor should avoid that. Perhaps an fflush() was already done, so it won't matter. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c39
--- Comment #39 from Martin Tessun
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c40
--- Comment #40 from Phil Bertin
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c41
--- Comment #41 from Neil Rickert
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c42
--- Comment #42 from Neil Rickert
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c43
Marius Tomaschewski
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c44
Marius Tomaschewski
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c45
--- Comment #45 from Neil Rickert
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c46
Neil Rickert
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c47
--- Comment #47 from Neil Rickert
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c48
Marius Tomaschewski
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c50
--- Comment #50 from Bernhard Wiedemann
https://bugzilla.novell.com/show_bug.cgi?id=732910
https://bugzilla.novell.com/show_bug.cgi?id=732910#c51
Marius Tomaschewski
participants (1)
-
bugzilla_noreply@novell.com