Commit 8ffb00f8 authored by Tomas Krizek's avatar Tomas Krizek Committed by Petr Špaček

systemd: use persistent cache by default

The /run directory is non-persistent. Use /var/cache/knot-resolver
as a persistent cache.
parent a2f07b30
......@@ -65,7 +65,7 @@ The daemon features a CLI interface, type ``help()`` to see the list of availabl
.. code-block:: bash
$ kresd /var/run/knot-resolver
$ kresd /var/cache/knot-resolver
[system] started in interactive mode, type 'help()'
> cache.count()
53
......@@ -155,7 +155,7 @@ comfortable in the current working directory.
.. code-block:: sh
$ kresd /var/run/kresd
$ kresd /var/cache/knot-resolver
And you're good to go for most use cases! If you want to use modules or configure daemon behavior, read on.
......
# Used for systemd activation
KRESD_ARGS="--config=/etc/knot-resolver/kresd.conf --verbose --forks=1 /var/cache/knot-resolver"
  • --verbose by default? @tkrizek: is that intentional? That will generate really lots of logs.

  • This was/is used in the Debian package. When using systemd, messages are logged to syslog. The logs will be compressed and various file size restrictions can be set.

    However, I'm not sure how much actual disk space could this use after some time, especially if also running multiple instances...

    Does the verbose option provide any messages that could be useful during regular operation? Or is it something that's usually turned on just for debugging purposes? If it's the latter, perhaps we shouldn't turn it on by default.

    Edited by Tomas Krizek
  • It's only meant for debugging particular requests. Messages considered useful for normal operation are output even without --verbose.

Please register or sign in to reply
# Standalone daemon arguments
DAEMON_ARGS="--addr=127.0.0.1#53 --addr=::1#53 $KRESD_ARGS"
......@@ -4,7 +4,7 @@ Documentation=man:kresd(8)
[Service]
Type=notify
WorkingDirectory=/run/knot-resolver/cache
WorkingDirectory=/var/cache/knot-resolver
EnvironmentFile=-/etc/default/kresd
ExecStart=/usr/sbin/kresd $KRESD_ARGS
User=knot-resolver
......
# tmpfiles.d(5) runtime directory for knot-resolver (kresd)
#Type Path Mode UID GID Age Argument
d /run/knot-resolver 0751 root root - -
d /run/knot-resolver/cache 0750 knot-resolver knot-resolver - -
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment