[Dnsmasq-discuss] Logging in DHCP script

Malte Forkel malte.forkel at berlin.de
Tue Mar 20 09:50:42 GMT 2012


>>
>> Can I detect in a DHCP script (specified by the dhcp-script option)
>> whether extra DHCP logging (specifed by log-dhcp) is activated in
>> dnsmasq? I would like to adapt the extent of my script's output to that
>> of dnsmasq.
>>
> Not directly. You can look in /etc/dnsmasq.conf, but that won't catch
> command-line arguments or other configuration files.
> 

Thanks for your help. I have now wrapped my logging code into a test for
log-dhcp:

    if grep -q -e '^log-dhcp' /etc/dnsmasq.conf; then
        logger -t "$LOGTAG" $*
    fi

Could I possibly persuade you to add an environment variable
DNSMASQ_LOG_DHCP that reflects log-dhcp?

Malte






More information about the Dnsmasq-discuss mailing list