Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 632644 - net-dns/unbound preserve cache on restart
Summary: net-dns/unbound preserve cache on restart
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Marc Schiffbauer
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-01 18:37 UTC by Forza
Modified: 2018-09-14 22:13 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/etc/init.d/unbound (unbound,1.58 KB, text/plain)
2017-10-01 18:37 UTC, Forza
Details
/etc/init.d/unbound.diff (unbound.diff,290 bytes, patch)
2017-10-01 18:38 UTC, Forza
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Forza 2017-10-01 18:37:30 UTC
Created attachment 497358 [details]
/etc/init.d/unbound

I think there should be an option to preserve the cache during restarts, especially on configurations with large memory cache.

This can be achieved with the dump_cache and load_cache commands to unbound-control:

       dump_cache
              The contents of the cache is printed in a text format to stdout.
              You can redirect it to a file to store the cache in a file.

       load_cache
              The  contents  of the cache is loaded from stdin.  Uses the same
              format as dump_cache uses.  Loading the cache with old, or wrong
              data can result in old or wrong data returned to clients.  Load-
              ing data into the cache in this way is supported in order to aid
              with debugging.

I've attached an uppdated unbound init.d file with dump_cache and load_cache added. I also added a --nicelevel which checks the UNBOUND_NICELEVEL= from /etc/conf.d/unbound
Comment 1 Forza 2017-10-01 18:38:44 UTC
Created attachment 497360 [details, diff]
/etc/init.d/unbound.diff

Added diff of original /etc/init.d/unbound and modified version.
Comment 2 Larry the Git Cow gentoo-dev 2018-09-14 22:13:50 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=76a0fe9aa1906a7bbe192efb56ef8335d21b9a3c

commit 76a0fe9aa1906a7bbe192efb56ef8335d21b9a3c
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2018-09-14 22:00:12 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2018-09-14 22:03:47 +0000

    net-dns/unbound: runscript rewritten
    
    - "need net" changed to "use net". If you need to bind service to a specific
      interface or address add 'rc_need="<interface>"' in /etc/conf.d/<unbound>.
    
    - Use "/run" instead of "/var/run".
    
    - Verify daemon is really up and running.
    
    - It is now possible to pass any by start-stop-daemon supported arguments
      to start-stop-daemon.
    
    - It is now possible to preserve unbound's cache. [Bug 632644]
    
    Closes: https://bugs.gentoo.org/632644
    Package-Manager: Portage-2.3.49, Repoman-2.3.10

 net-dns/unbound/files/unbound-r1.confd  |  36 +++++++++
 net-dns/unbound/files/unbound-r1.initd  | 137 ++++++++++++++++++++++++++++++++
 net-dns/unbound/unbound-1.7.3-r1.ebuild |   6 +-
 net-dns/unbound/unbound-1.8.0-r1.ebuild |  11 ++-
 4 files changed, 184 insertions(+), 6 deletions(-)