Re: Environment variable set in the dhcpcd.conf profile is not passed to dhcpcd run hooks
Carbolymer
Mon Feb 26 18:01:07 2018
Hi,
Thanks for the reply.
I've run dhcpd -d and added debug to the dhcpcd.conf file. Here's the
output as well as dhcpcd.conf file with the hook (41-var-test):
https://gist.github.com/carbolymer/e386c935546ba52b97630e6165641438
The hardware address I took from the arping output (also in the gist)
Best regards,
Carbolymer
On 20 February 2018 at 16:30, Roy Marples <roy@xxxxxxxxxxxx> wrote:
> Hi
>
> On 19/02/2018 13:21, Carbolymer wrote:
>
>> I've encountered strange issue, when I set variable in the profile in the
>> /etc/dhcpcd.conf it is not passed to the hook script:
>>
>> interface eth0
>> arping 192.168.0.1
>>
>> profile xx:xx:xx:xx:xx:xx
>> env enable_proxy=1
>>
>> However, when I put the variable before the profile, like this:
>>
>> interface eth0
>> arping 192.168.0.1
>> env enable_proxy=1
>>
>> profile xx:xx:xx:xx:xx:xx
>>
>> it is suddenly visible inside the hook script. What is going on? The
>> profile is executed correctly - the network configuration inside it is
>> evaluated properly but env option has no effect. How can I set environment
>> variables for hook scripts from dhcpcd profile?
>>
>
> I cannot replicate this using dhcpcd-7.
> In both cases, the variable is available to the hook scripts.
> What version are you using?
>
> At a guess, the profile you specified isn't being loaded - maybe a typo in
> the name hardware address?
> Try adding a profile for 192.168.0.1 as well
> Also, try adding the debug command at the top of dhcpcd.conf and re-trying.
> You'll then see messages in the log such as
> eth0: no profile XX:XX:XX:XX:XX:XX
> eth0: selected profile 192.168.0.1
>
> IF you see that then there is a typo in your hardware address profile name.
>
> Roy
>
Archive administrator: postmaster@marples.name