RE: TIMEOUT Reason Code
David Hauck
Thu Jun 22 16:29:59 2017
Hi Roy,
On Thursday, June 22, 2017 1:06 AM, Roy Marples wrote:
> Hi David
>
> Sorry for the late reply.
>
> On 16/06/2017 21:17, David Hauck wrote:
>> We both had a discussion some time ago (May '16) about the TIMEOUT reason code. At that time we
> were running v6.7.x and you indicated this reason code wasn't properly being passed to the hook
> scripts. You indicated this was fixed in v6.11. I'm using v6.11.5 now and am still unable to see these
> messages.
>>
>> When 'dhcpcd' times out during DISCOVER (timeout=30) or a REBIND:(reboot=30) I simply see
> 'dhcpcd' exit. Here's what I see on the console (the 60-custom is my hook script, which is simply
> reporting the reason states):
>>
>> # ifup eth0
>> eth0: 60-custom: received reason=PREINIT
>> eth0: 60-custom: received reason=CARRIER DUIID
>> 00:01:00:01:20:93:eb:08:00:02:b3:cd:61:9b
>> etho: IAID b3:cd:61:9b
>> eth0: soliciting a DHCP lease
>> timed out
>> dhcpcd exited
>>
>> I see all of the above in syslog as well, except I don't see the "timeout out" line(?).
>>
>> Is there something different I need to be doing in order to see the
>> TIMEOUT reason code in my hook script?
>>
>> My configuration includes "lastlease". The results are identical regardless of whether or not I include
> "persistent".
>
> Well, the last lease file does need to exist, which means you have to include persistent. If persistent is
> disabled, the lease file will be deleted at exit automatically, so ensure you have lease file first!
> You also have to disable IPv4LL as the two styles conflict and IPv4LL takes precedence.
Ya, this is why I'm getting confused: I have noipv4ll in my configuration and *no persistent* and when I bring down the interface (ifdown eth0) I see the lease file at /var/db/dhcpcd-eth0.lease (and a dhcpcd -U eth0 shows its contents). From what you say above I shouldn't be seeing this file, right?
> If you still have trouble, try adding the debug directive dhcpcd.conf and check in your logs.
> The logfile option may also be of use if your syslog implementation isn't capturing everything.
Now I'm really confused! When I enable 'debug' in the log *I now see the TIMEOUT reason code in my hook script*. (???) I also see that when I run 'ifup eth0' with debug in the configuration the process is immediately forked into the background and 'ifup' returns immediately; this is not the case when 'debug' is not defined (in this latter case 'ifup' doesn't return until 'dhcpcd' times out - and I see "timed out/dhcpcd exited" in the console just prior to 'ifup' returning). What's going on here?
-David
> I tested dhcpcd-6.11.5 and the latest dhcpcd-7 code and it works fine
>
> Saying that, there is an issue where the lease will be discarded if it
> has expired when dhcpcd starts up. If this is your issue, subscribe to
> the below task and we'll see about fixing it.
> https://dev.marples.name/T124
>
> Roy
Archive administrator: postmaster@marples.name