Unbound 1.6.1rc1 prerelease

Hi Luiz,

Thank you for your patch. I have included it (but not in 1.6.1, but it
is in the code repository for 1.6.2).

Modified the patch a bit to clean it up and I added unbound-control
stats_shm, that makes unbound-control print out the normal stats output
from it, but using shm to get the information.

I also added shm-enable and shm-key to unbound.conf. Disabled by default.

Not sure when to reset the memory, so I didn't. I guess unbound-control
could reset the memory after printing out the results (unless 'noreset')?

The .h file is harder, unbound.h that gets installed is the obvious
choide, but not sure how to deal with version changes, and different
statistics output...

Best regards, Wouter

Sorry for the delay, I had personal problems for some days.

Thank you for include my patch. This will be very usefull.

I had read the modifications you have made. This is great. :slight_smile:

For me, I don’t need to reset the memory.

Because the SHM isn’t like stats, even stats_noreset. There is no known in unbound (daemon), that someone is reading the memory (I think).

And, SHM will be always the current stats info (total + worker). So, if someone reset stats, using ‘unbound-control stats’, SHM will be reseted to.

We just need this 2, for SHM in read ‘client side’
Both are in /daemon/stats.h

struct server_stats
struct stats_info

Maybe, when compiling this file can go to system include files.
In FreeBSD, the .h file goes to /usr/local/include/

Then
/usr/local/include/unbound_stats.h

Or something like this.

SHM, is to be used in the same machine, with the same struct.

So, when I change unbound, I need to recompile my daemon.
It’s the price. And I pay smiling.

Best regards, Softov