Unbound service stop when adding a new host override

Started by nono, November 16, 2022, 04:20:06 PM

Previous topic - Next topic
As soon as I add a new host overrides and click on "Apply", the Unbound DNS Service stop and the status on the high part of the page disappear.

I can start it back by going on the "general" part and then, the service starts (and the override works normally)

I made 2 screenshots, one before :


After adding a new entry and clicking on "apply" :



EDIT: not sure it's related but here is a Backend log :
Quote2022-11-16T16:16:30   Error   configd.py   [xx-xxx-xxx-xx] Script action stderr returned "b'pgrep: Cannot get process list (kvm_getprocs: No such process)'"

November 18, 2022, 08:36:15 PM #1 Last Edit: November 21, 2022, 08:41:12 PM by Fright
Hi
ubound should stop (or rather reload restart) after applying the parameters.
unbound is pretty lazy on start so querying the unbound status right after applying params may return "stopped". and in normal cases you can just refresh the page

"Cannot get process list (kvm_getprocs: No such process)'" can also be explained - if pgrep can not find process it return "1" and writes message to stderr (and this behaviour cannot be disabled with -q switch). so backend process sends this message to backend log.
so this message appears in the backend log every time the status of the unbound service is requested if it is stopped (don't know if it's worth making a pr for pgrep output redirect for "unbound status" action)

the disappearance of the buttons in the right corner looks strange. like the backend not returns "stopped" or "running" for unbound status request..
could you please look at the server response in the browser dev console? (after "apply" click there will be a /api/unbound/service/status request. response should contain a "status" result)

Hi @Fright,

Thanks for the answer.

To me, it seems that the normal behavior should be rather a reload than a stop (or slightly better, a restart). At least, if this is possible at all ?

After hitting "apply" (even without modification) and refreshing the page, the unbound service is still stopped.

When I hit "apply" here is the server response for status :
{"status":"disabled","widget":{"caption_stop":"stop service","caption_start":"start service","caption_restart":"restart service"}}

FYI, the "reconfigure" gave me this :
{"status":"ok"}

November 21, 2022, 08:35:14 PM #3 Last Edit: November 21, 2022, 08:40:35 PM by Fright
Hi
Quotereload than a stop (or slightly better, a restart). At least, if this is possible at all ?
not sure I understood you correctly, but yes, the reconfigure procedure implies both a (soft) reload and a (forced) restart. in the case of an unbound, a restart occurs. which means stop and start). The launch in the case of an unbound takes quite a long time. so on a quick status request (right after the reconfigure request), the backend may return a "stopped" status. but, of course, should not return the "disabled" status..

Quote{"status":"disabled",
yes, this weird
can you please try to hit Save on Services: Unbound DNS: General (this should overwrite unbound.enable key in config) and try again?

Hi @Fright,

That seems to work well !
I did a "Save" (then "Apply changes") on Services: Unbound DNS: General

Then try to apply a changes on Services: Unbound DNS: Overrides

And the service remains Started !

Regarding my "suggestion" : I think the following behavior should be the default one:
making a changes (on overrides) and "apply" it, should only reload the unbound server and/or restart the service, but never STOP it.
It seems that since I've "save" it on general, it's now the default (and correct) behavior.

Shall I mark this topic as resolved or let it openned to somehow fix this "bug" ?

Hi
glad it works!  ;)
To be honest, I don't see any signs of a "bug" (rather corrupted config), except perhaps a misleading error message in the backend log

> making a changes (on overrides) and "apply" it, should only reload the unbound server and/or restart the service, but never STOP it.

And so if during restart unbound does not create pid file or start quickly enough you can't tell users it's up and running?


Cheers,
Franco