diff mbox

[LEDE-DEV,v5] dnsmasq: also write /tmp/resolv.conf when UCI dhcp.dnsmasq.noresolv is '1'

Message ID 20170514182237.46209-1-por@xs4all.nl
State Changes Requested
Headers show

Commit Message

Paul Oranje May 14, 2017, 6:22 p.m. UTC
fixes FS#785

Signed-off-by: Paul Oranje <por@xs4all.nl>
---
 package/network/services/dnsmasq/files/dnsmasq.init | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Hans Dedecker May 18, 2017, 2:53 p.m. UTC | #1
On Sun, May 14, 2017 at 8:22 PM, Paul Oranje <por@xs4all.nl> wrote:
>
> fixes FS#785
>
Hi,

Thanks for the patch but be more verbose in the comment description
what problem you're trying to solve; the commit subject should be
limited to 50 characters.
See also https://lede-project.org/submitting-patches
>
> Signed-off-by: Paul Oranje <por@xs4all.nl>
> ---
>  package/network/services/dnsmasq/files/dnsmasq.init | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
> index 30fec7a4ee..197aae9de1 100644
> --- a/package/network/services/dnsmasq/files/dnsmasq.init
> +++ b/package/network/services/dnsmasq/files/dnsmasq.init
> @@ -947,7 +947,7 @@ dnsmasq_start()
>         echo >> $CONFIGFILE_TMP
>         mv -f $CONFIGFILE_TMP $CONFIGFILE
>
> -       [ "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
> +       [ "$noresolv" = "1" -o "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
>                 rm -f /tmp/resolv.conf
>                 [ $ADD_LOCAL_DOMAIN -eq 1 ] && [ -n "$DOMAIN" ] && {
>                         echo "search $DOMAIN" >> /tmp/resolv.conf
> @@ -982,7 +982,7 @@ dnsmasq_stop()
>         config_get resolvfile "$cfg" "resolvfile"
>
>         #relink /tmp/resolve.conf only for main instance
> -       [ "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
> +       [ "$noresolv" = "1" -o "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
noresolv needs to be read from the config which is not the case
>                 [ -f /tmp/resolv.conf ] && {
>                         rm -f /tmp/resolv.conf
>                         ln -s "$resolvfile" /tmp/resolv.conf
this will generate an error now if resolvfile is empty
> --
> 2.12.2
>
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev

Hans
Paul Oranje May 19, 2017, 10:58 a.m. UTC | #2
Oké, I’ll submit another version with the requested changes later today.
This trivial change is turning out a ping pong lesson. Thanks anyway,
Paul


> Op 18 mei 2017, om 16:53 heeft Hans Dedecker <dedeckeh@gmail.com> het volgende geschreven:
> 
> On Sun, May 14, 2017 at 8:22 PM, Paul Oranje <por@xs4all.nl> wrote:
>> 
>> fixes FS#785
>> 
> Hi,
> 
> Thanks for the patch but be more verbose in the comment description
> what problem you're trying to solve; the commit subject should be
> limited to 50 characters.
> See also https://lede-project.org/submitting-patches
>> 
>> Signed-off-by: Paul Oranje <por@xs4all.nl>
>> ---
>> package/network/services/dnsmasq/files/dnsmasq.init | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>> 
>> diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
>> index 30fec7a4ee..197aae9de1 100644
>> --- a/package/network/services/dnsmasq/files/dnsmasq.init
>> +++ b/package/network/services/dnsmasq/files/dnsmasq.init
>> @@ -947,7 +947,7 @@ dnsmasq_start()
>>        echo >> $CONFIGFILE_TMP
>>        mv -f $CONFIGFILE_TMP $CONFIGFILE
>> 
>> -       [ "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
>> +       [ "$noresolv" = "1" -o "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
>>                rm -f /tmp/resolv.conf
>>                [ $ADD_LOCAL_DOMAIN -eq 1 ] && [ -n "$DOMAIN" ] && {
>>                        echo "search $DOMAIN" >> /tmp/resolv.conf
>> @@ -982,7 +982,7 @@ dnsmasq_stop()
>>        config_get resolvfile "$cfg" "resolvfile"
>> 
>>        #relink /tmp/resolve.conf only for main instance
>> -       [ "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
>> +       [ "$noresolv" = "1" -o "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
> noresolv needs to be read from the config which is not the case
>>                [ -f /tmp/resolv.conf ] && {
>>                        rm -f /tmp/resolv.conf
>>                        ln -s "$resolvfile" /tmp/resolv.conf
> this will generate an error now if resolvfile is empty
>> --
>> 2.12.2
>> 
>> 
>> _______________________________________________
>> Lede-dev mailing list
>> Lede-dev@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/lede-dev
> 
> Hans
> 
> _______________________________________________
> Lede-dev mailing list
> Lede-dev@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev
Paul Oranje May 19, 2017, 2:13 p.m. UTC | #3
Question: when the subject is changed in order the make it less than 50 characters long, does that result in a distinct new patch ?
Paul

> Op 19 mei 2017, om 12:58 heeft Paul Oranje <por@xs4all.nl> het volgende geschreven:
> 
> Oké, I’ll submit another version with the requested changes later today.
> This trivial change is turning out a ping pong lesson. Thanks anyway,
> Paul
> 
> 
>> Op 18 mei 2017, om 16:53 heeft Hans Dedecker <dedeckeh@gmail.com> het volgende geschreven:
>> 
>> On Sun, May 14, 2017 at 8:22 PM, Paul Oranje <por@xs4all.nl> wrote:
>>> 
>>> fixes FS#785
>>> 
>> Hi,
>> 
>> Thanks for the patch but be more verbose in the comment description
>> what problem you're trying to solve; the commit subject should be
>> limited to 50 characters.
>> See also https://lede-project.org/submitting-patches
>>> 
>>> Signed-off-by: Paul Oranje <por@xs4all.nl>
>>> ---
>>> package/network/services/dnsmasq/files/dnsmasq.init | 4 ++--
>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>> 
>>> diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
>>> index 30fec7a4ee..197aae9de1 100644
>>> --- a/package/network/services/dnsmasq/files/dnsmasq.init
>>> +++ b/package/network/services/dnsmasq/files/dnsmasq.init
>>> @@ -947,7 +947,7 @@ dnsmasq_start()
>>>       echo >> $CONFIGFILE_TMP
>>>       mv -f $CONFIGFILE_TMP $CONFIGFILE
>>> 
>>> -       [ "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
>>> +       [ "$noresolv" = "1" -o "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
>>>               rm -f /tmp/resolv.conf
>>>               [ $ADD_LOCAL_DOMAIN -eq 1 ] && [ -n "$DOMAIN" ] && {
>>>                       echo "search $DOMAIN" >> /tmp/resolv.conf
>>> @@ -982,7 +982,7 @@ dnsmasq_stop()
>>>       config_get resolvfile "$cfg" "resolvfile"
>>> 
>>>       #relink /tmp/resolve.conf only for main instance
>>> -       [ "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
>>> +       [ "$noresolv" = "1" -o "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
>> noresolv needs to be read from the config which is not the case
>>>               [ -f /tmp/resolv.conf ] && {
>>>                       rm -f /tmp/resolv.conf
>>>                       ln -s "$resolvfile" /tmp/resolv.conf
>> this will generate an error now if resolvfile is empty
>>> --
>>> 2.12.2
>>> 
>>> 
>>> _______________________________________________
>>> Lede-dev mailing list
>>> Lede-dev@lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/lede-dev
>> 
>> Hans
>> 
>> _______________________________________________
>> Lede-dev mailing list
>> Lede-dev@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/lede-dev
> 
> 
> _______________________________________________
> Lede-dev mailing list
> Lede-dev@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev
Hans Dedecker May 19, 2017, 8:37 p.m. UTC | #4
On Fri, May 19, 2017 at 4:13 PM, Paul Oranje <por@xs4all.nl> wrote:
> Question: when the subject is changed in order the make it less than 50 characters long, does that result in a distinct new patch ?
> Paul
Yes that results into a new distinct patch in patchwork

Hans
>
>> Op 19 mei 2017, om 12:58 heeft Paul Oranje <por@xs4all.nl> het volgende geschreven:
>>
>> Oké, I’ll submit another version with the requested changes later today.
>> This trivial change is turning out a ping pong lesson. Thanks anyway,
>> Paul
>>
>>
>>> Op 18 mei 2017, om 16:53 heeft Hans Dedecker <dedeckeh@gmail.com> het volgende geschreven:
>>>
>>> On Sun, May 14, 2017 at 8:22 PM, Paul Oranje <por@xs4all.nl> wrote:
>>>>
>>>> fixes FS#785
>>>>
>>> Hi,
>>>
>>> Thanks for the patch but be more verbose in the comment description
>>> what problem you're trying to solve; the commit subject should be
>>> limited to 50 characters.
>>> See also https://lede-project.org/submitting-patches
>>>>
>>>> Signed-off-by: Paul Oranje <por@xs4all.nl>
>>>> ---
>>>> package/network/services/dnsmasq/files/dnsmasq.init | 4 ++--
>>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
>>>> index 30fec7a4ee..197aae9de1 100644
>>>> --- a/package/network/services/dnsmasq/files/dnsmasq.init
>>>> +++ b/package/network/services/dnsmasq/files/dnsmasq.init
>>>> @@ -947,7 +947,7 @@ dnsmasq_start()
>>>>       echo >> $CONFIGFILE_TMP
>>>>       mv -f $CONFIGFILE_TMP $CONFIGFILE
>>>>
>>>> -       [ "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
>>>> +       [ "$noresolv" = "1" -o "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
>>>>               rm -f /tmp/resolv.conf
>>>>               [ $ADD_LOCAL_DOMAIN -eq 1 ] && [ -n "$DOMAIN" ] && {
>>>>                       echo "search $DOMAIN" >> /tmp/resolv.conf
>>>> @@ -982,7 +982,7 @@ dnsmasq_stop()
>>>>       config_get resolvfile "$cfg" "resolvfile"
>>>>
>>>>       #relink /tmp/resolve.conf only for main instance
>>>> -       [ "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
>>>> +       [ "$noresolv" = "1" -o "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
>>> noresolv needs to be read from the config which is not the case
>>>>               [ -f /tmp/resolv.conf ] && {
>>>>                       rm -f /tmp/resolv.conf
>>>>                       ln -s "$resolvfile" /tmp/resolv.conf
>>> this will generate an error now if resolvfile is empty
>>>> --
>>>> 2.12.2
>>>>
>>>>
>>>> _______________________________________________
>>>> Lede-dev mailing list
>>>> Lede-dev@lists.infradead.org
>>>> http://lists.infradead.org/mailman/listinfo/lede-dev
>>>
>>> Hans
>>>
>>> _______________________________________________
>>> Lede-dev mailing list
>>> Lede-dev@lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/lede-dev
>>
>>
>> _______________________________________________
>> Lede-dev mailing list
>> Lede-dev@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/lede-dev
>
diff mbox

Patch

diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index 30fec7a4ee..197aae9de1 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -947,7 +947,7 @@  dnsmasq_start()
 	echo >> $CONFIGFILE_TMP
 	mv -f $CONFIGFILE_TMP $CONFIGFILE
 
-	[ "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
+	[ "$noresolv" = "1" -o "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
 		rm -f /tmp/resolv.conf
 		[ $ADD_LOCAL_DOMAIN -eq 1 ] && [ -n "$DOMAIN" ] && {
 			echo "search $DOMAIN" >> /tmp/resolv.conf
@@ -982,7 +982,7 @@  dnsmasq_stop()
 	config_get resolvfile "$cfg" "resolvfile"
 
 	#relink /tmp/resolve.conf only for main instance
-	[ "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
+	[ "$noresolv" = "1" -o "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
 		[ -f /tmp/resolv.conf ] && {
 			rm -f /tmp/resolv.conf
 			ln -s "$resolvfile" /tmp/resolv.conf