Commit 7f12b24e authored by Marek Vavruša's avatar Marek Vavruša

daemon: updated doc

parent fc5a4eaa
......@@ -22,13 +22,6 @@
#include "lib/cache.h"
#include "lib/defines.h"
/*
* Defines
*/
#define CACHE_DEFAULT_PATH "/tmp/kresolved"
#define CACHE_DEFAULT_SIZE 10*(1024*1024)
/*
* Global bindings.
*/
......@@ -39,6 +32,11 @@ static int l_help(lua_State *L)
static const char *help_str =
"help()\n show this help\n"
"quit()\n quit\n"
"modules.list()\n list modules\n"
"modules.load()\n load module\n"
"modules.unload()\n unload module\n"
"cache.open(path, max_size)\n open cache\n"
"cache.close()\n close cache\n"
;
puts(help_str);
/* No results */
......
......@@ -32,11 +32,12 @@ The following is a list of software required to build Knot DNS Resolver from sou
"C compiler", "*all*", "*(build only)* [#]_"
"libknot_ 2.0+", "*all*", "Knot DNS library."
There are also *optional* packages that enable specific functionality in Knot DNS Resolver, apart from the `libuv_` and `GCCGO`_, they are useful mainly for developers to build documentation and tests.
There are also *optional* packages that enable specific functionality in Knot DNS Resolver, apart from the `libuv`_ and `GCCGO`_, they are useful mainly for developers to build documentation and tests.
.. csv-table::
:header: "Requirement", "Required by", "Notes"
"Lua_ 5.1+", "``daemon``", "Embeddable scripting language (LuaJIT_ is preferred)."
"libuv_ 1.0+", "``daemon``", "Multiplatform I/O and services."
"cmocka_", "``unit tests``", "Unit testing framework."
"Python_", "``integration tests``", "For scripting tests, C header files are required (``python-dev``)"
......
Configuration reference
-----------------------
\ No newline at end of file
Daemon configuration
--------------------
The Knot DNS Resolver daemon has no traditional concept of static configuration.
In it's simplest form it requires just a working directory in which it can set up persistent files like
cache and the process state.
.. code-block:: sh
$ kresolved /var/run/kresolved
And you're good to go!
Introduction
~~~~~~~~~~~~
There are several choices on how you can configure the daemon, a RPC interface a CLI or a configuration file,
but fortunately all share a common syntax and are transparent to each other, e.g. if you change a knob, you're going to
see it projected to other interfaces as well.
.. note:: Expect this page to change a lot, as it's still just a proof of concept implementation.
Configuration 101
~~~~~~~~~~~~~~~~~
If there is a `config` file in the daemon working directory, it's going to get loaded automatically, if there isn't one
the daemon is going to start with sane defaults and listening on `localhost`. The syntax for options is like follows: ``group.option = value``
or ``group.action(parameters)``. You can also comment using a ``--`` prefix.
A simple example would be to increase the cache size.
.. code-block:: lua
-- increase the cache to 100MB
cache.open(".", 100*1024*1024)
Dynamic configuration
~~~~~~~~~~~~~~~~~~~~~
Packages and services
~~~~~~~~~~~~~~~~~~~~~
The Lua supports a concept called closures, this is extremely useful for scripting actions upon various events.
.. note:: TODO, come back later!
* Timers and events
* File watchers
* Serialization
* Data I/O
......@@ -31,6 +31,6 @@ You can load modules this way and use their properties to get information about
$ kresolved /var/run/knot-resolver
...
[system] started in interactive mode, type 'help()'
> module.load('cachectl')
> modules.load('cachectl')
> return cachectl.size()
{ "size": 53 }
\ No newline at end of file
......@@ -9,10 +9,10 @@ Modular architecture of the library keeps the core tiny and efficient, and provi
:maxdepth: 2
build
daemon
lib
modules
daemon
config
modules
Indices and tables
......
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