unbound: speed-up remove forwarders

Message ID 20200301194113.16841-1-arne_f@ipfire.org
State Accepted
Commit 770a1507dd750fe98f327919c9da576d6b996469
Headers
Series unbound: speed-up remove forwarders |

Commit Message

Arne Fitzenreiter March 1, 2020, 7:41 p.m. UTC
  Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
---
 src/initscripts/system/unbound | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

Michael Tremer March 2, 2020, 12:06 p.m. UTC | #1
Hi,

I am not entirely happy with the style of this fix, but it good enough to be shipped as a hot fix for now.

I will have a look to remove too many steps during the reload phase and that potentially includes finding another way how to handle Safe Search.

Thanks for looking into this.

Best,
-Michael

> On 1 Mar 2020, at 19:41, Arne Fitzenreiter <arne_f@ipfire.org> wrote:
> 
> Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
> ---
> src/initscripts/system/unbound | 4 ++++
> 1 file changed, 4 insertions(+)
> 
> diff --git a/src/initscripts/system/unbound b/src/initscripts/system/unbound
> index b3185feab..0aab6cc8c 100644
> --- a/src/initscripts/system/unbound
> +++ b/src/initscripts/system/unbound
> @@ -595,6 +595,10 @@ case "$1" in
> 		# Call unbound-control and perform the reload
> 		/usr/sbin/unbound-control -q reload
> 
> +		if [ "$1" = "remove-forwarders" ]; then
> +			exit 0
> +		fi
> +
> 		# Dummy Resolve to wait for unbound
> 		resolve "ping.ipfire.org" &>/dev/null
> 
> -- 
> 2.17.1
>
  
Arne Fitzenreiter March 2, 2020, 4:08 p.m. UTC | #2
After thinking a bit more...

do we need to reload unbound at red down ?
It should make no difference if we simple remove this "remove 
forwarders" and its call in red down.

Arne


Am 2020-03-02 17:02, schrieb Arne Fitzenreiter:
> Hi,
> 
> i have no better Idea.
> 
> unbound remove-forwarders not really remove the forwarders since last
> changes but
> it is called at red down so the initskript should exit after reload and 
> not try
> to resolve any domains.
> 
> Arne
> 
> 
> Am 2020-03-02 13:06, schrieb Michael Tremer:
>> Hi,
>> 
>> I am not entirely happy with the style of this fix, but it good enough
>> to be shipped as a hot fix for now.
>> 
>> I will have a look to remove too many steps during the reload phase
>> and that potentially includes finding another way how to handle Safe
>> Search.
>> 
>> Thanks for looking into this.
>> 
>> Best,
>> -Michael
>> 
>>> On 1 Mar 2020, at 19:41, Arne Fitzenreiter <arne_f@ipfire.org> wrote:
>>> 
>>> Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
>>> ---
>>> src/initscripts/system/unbound | 4 ++++
>>> 1 file changed, 4 insertions(+)
>>> 
>>> diff --git a/src/initscripts/system/unbound 
>>> b/src/initscripts/system/unbound
>>> index b3185feab..0aab6cc8c 100644
>>> --- a/src/initscripts/system/unbound
>>> +++ b/src/initscripts/system/unbound
>>> @@ -595,6 +595,10 @@ case "$1" in
>>> 		# Call unbound-control and perform the reload
>>> 		/usr/sbin/unbound-control -q reload
>>> 
>>> +		if [ "$1" = "remove-forwarders" ]; then
>>> +			exit 0
>>> +		fi
>>> +
>>> 		# Dummy Resolve to wait for unbound
>>> 		resolve "ping.ipfire.org" &>/dev/null
>>> 
>>> --
>>> 2.17.1
>>>
  
Michael Tremer March 3, 2020, 12:02 p.m. UTC | #3
Hi,

No, we do not need to reload it.

-Michael

> On 2 Mar 2020, at 16:08, Arne Fitzenreiter <arne_f@ipfire.org> wrote:
> 
> After thinking a bit more...
> 
> do we need to reload unbound at red down ?
> It should make no difference if we simple remove this "remove forwarders" and its call in red down.
> 
> Arne
> 
> 
> Am 2020-03-02 17:02, schrieb Arne Fitzenreiter:
>> Hi,
>> i have no better Idea.
>> unbound remove-forwarders not really remove the forwarders since last
>> changes but
>> it is called at red down so the initskript should exit after reload and not try
>> to resolve any domains.
>> Arne
>> Am 2020-03-02 13:06, schrieb Michael Tremer:
>>> Hi,
>>> I am not entirely happy with the style of this fix, but it good enough
>>> to be shipped as a hot fix for now.
>>> I will have a look to remove too many steps during the reload phase
>>> and that potentially includes finding another way how to handle Safe
>>> Search.
>>> Thanks for looking into this.
>>> Best,
>>> -Michael
>>>> On 1 Mar 2020, at 19:41, Arne Fitzenreiter <arne_f@ipfire.org> wrote:
>>>> Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
>>>> ---
>>>> src/initscripts/system/unbound | 4 ++++
>>>> 1 file changed, 4 insertions(+)
>>>> diff --git a/src/initscripts/system/unbound b/src/initscripts/system/unbound
>>>> index b3185feab..0aab6cc8c 100644
>>>> --- a/src/initscripts/system/unbound
>>>> +++ b/src/initscripts/system/unbound
>>>> @@ -595,6 +595,10 @@ case "$1" in
>>>> 		# Call unbound-control and perform the reload
>>>> 		/usr/sbin/unbound-control -q reload
>>>> +		if [ "$1" = "remove-forwarders" ]; then
>>>> +			exit 0
>>>> +		fi
>>>> +
>>>> 		# Dummy Resolve to wait for unbound
>>>> 		resolve "ping.ipfire.org" &>/dev/null
>>>> --
>>>> 2.17.1
  

Patch

diff --git a/src/initscripts/system/unbound b/src/initscripts/system/unbound
index b3185feab..0aab6cc8c 100644
--- a/src/initscripts/system/unbound
+++ b/src/initscripts/system/unbound
@@ -595,6 +595,10 @@  case "$1" in
 		# Call unbound-control and perform the reload
 		/usr/sbin/unbound-control -q reload
 
+		if [ "$1" = "remove-forwarders" ]; then
+			exit 0
+		fi
+
 		# Dummy Resolve to wait for unbound
 		resolve "ping.ipfire.org" &>/dev/null