dhcpcd-discuss

RE: Terminating 'dhcpcd' From a Hook Script

David Hauck

Thu Jun 15 17:03:20 2017

On Thursday, June 15, 2017 9:56 AM, David Hauck wrote:
> On Thursday, June 15, 2017 9:45 AM, Roy Marples wrote:
>> On 15/06/2017 17:43, David Hauck wrote:
>>> Hi Roy,
>>> 
>>> On Thursday, June 15, 2017 9:16 AM, Roy Marples wrote:
>>>> On 15/06/2017 17:13, David Hauck wrote:
>>>>> So in my case I would then need to invoke: 'dhcpcd -4 -x eth0'?
>>>>> Would this terminate (and not de-
>>>> configure) the proper IPv4 invocation of 'dhcpcd' on eth0?
>>>> 
>>>> Exactly so.
>>> 
>>> This doesn't seem to be working for me (or it's at least not doing
>>> what I want it to do - specifically, terminate 'dhcpcd' without
>>> de-configuring the interface).
>>> 
>>> I see my hook script invoke 'dhcpcd -4 eth0' on the BOUND reason. And
>>> I see the following in syslog as a result:
>>> 
>>> 20170615 09:32:22.864 info daemon(dhcpcd-run-hooks):eth0: 60-xxxx:
>>> received reason=BOUND 20170615 09:32:23.020 info
>>> daemon(dhcpcd-run-hooks):eth0: 60-xxxx: terminating 'dhcpcd -4 eth0'
>>> 20170615 09:32:23.027 info daemon(dhcpcd):sending commands to master
>>> dhcpcd process 20170615 09:32:23.031 info daemon(dhcpcd):control
>>> command: dhcpcd -4 -x eth0 20170615 09:32:23.031 info
>>> daemon(dhcpcd):eth0: removing interface 20170615 09:32:23.031 info
>>> daemon(dhcpcd):eth0: deleting default route via 205.159.216.130
>>> 20170615 09:32:23.031 info daemon(dhcpcd):eth0: deleting route to
>>> 205.159.216.128/25 20170615 09:32:23.036 info daemon(dhcpcd):forked
>>> to background, child pid 2277 20170615 09:32:23.045 info
>>> daemon(dhcpcd-run-hooks):eth0: 60-xxxx: received reason=STOP 20170615
>>> 09:32:23.054 info daemon(dhcpcd-run-hooks):eth0: 60-xxxx: received
>>> reason=STOPPED
>>> 
>>> This is with 'master' in the configuration file (without master the attempt to call 'dhcpcd -x' times
> out).
>> The problem here is that I don't want this termination to result in
>> the interface being de-configured. So, is there a way around this?
>> 
>> Add the word `persistent` to dhcpcd.conf It's there by default.
> 
> ;) OK, that's working, thx. For some reasons I thought this option was on by default; but I now think I
> misunderstood your "there by default" as "on by default" (i.e., the default .conf file has this specified) :).

Actually, another reason I thought this was on "by default" was because I see that the 'lastlease' option is working when no server is available and a timeout occurs. My understanding was that this shouldn't work without 'persistent' also specified (??).
 
> I'll continue testing with our various scenarios to see if this new configuration works for us.
> 
> -David
> 
>> Roy

References:
Terminating 'dhcpcd' From a Hook ScriptDavid Hauck
Re: Terminating 'dhcpcd' From a Hook ScriptRoy Marples
RE: Terminating 'dhcpcd' From a Hook ScriptDavid Hauck
Re: Terminating 'dhcpcd' From a Hook ScriptRoy Marples
RE: Terminating 'dhcpcd' From a Hook ScriptDavid Hauck
Re: Terminating 'dhcpcd' From a Hook ScriptRoy Marples
RE: Terminating 'dhcpcd' From a Hook ScriptDavid Hauck
Re: Terminating 'dhcpcd' From a Hook ScriptRoy Marples
RE: Terminating 'dhcpcd' From a Hook ScriptDavid Hauck
Archive administrator: postmaster@marples.name