Skip to content
Snippets Groups Projects
Commit cc37277f authored by Daniel Salzman's avatar Daniel Salzman
Browse files

conf: add zone.journal option

parent 44aee437
Branches
Tags
No related merge requests found
......@@ -694,8 +694,9 @@ Definition of zones served by the server.
zone:
\- domain: DNAME
template: template_id
file: STR
storage: STR
file: STR
journal: STR
master: remote_id ...
ddns\-master: remote_id
notify: remote_id ...
......@@ -724,6 +725,11 @@ A zone name identifier.
A \fI\%reference\fP to a configuration template.
.sp
\fIDefault:\fP not set or \fIdefault\fP (if the template exists)
.SS storage
.sp
A data directory for storing zone files, journal files and timers database.
.sp
\fIDefault:\fP \fB${localstatedir}/lib/knot\fP (configured with \fB\-\-with\-storage=path\fP)
.SS file
.sp
A path to the zone file. Non absolute path is relative to
......@@ -749,11 +755,13 @@ terminating dot (the result for the root zone is the empty string!).
.UNINDENT
.sp
\fIDefault:\fP \fI\%storage\fP/\fB%s\fP\&.zone
.SS storage
.SS journal
.sp
A data directory for storing zone files, journal files and timers database.
A path to the zone journal. Non absolute path is relative to
\fI\%storage\fP\&. The same set of formatters as for
\fI\%file\fP is supported.
.sp
\fIDefault:\fP \fB${localstatedir}/lib/knot\fP (configured with \fB\-\-with\-storage=path\fP)
\fIDefault:\fP \fI\%storage\fP/\fB%s\fP\&.db
.SS master
.sp
An ordered list of \fI\%references\fP to zone master servers.
......
......@@ -834,8 +834,9 @@ Definition of zones served by the server.
zone:
- domain: DNAME
template: template_id
file: STR
storage: STR
file: STR
journal: STR
master: remote_id ...
ddns-master: remote_id
notify: remote_id ...
......@@ -869,6 +870,15 @@ A :ref:`reference<template_id>` to a configuration template.
*Default:* not set or *default* (if the template exists)
.. _zone_storage:
storage
-------
A data directory for storing zone files, journal files and timers database.
*Default:* ``${localstatedir}/lib/knot`` (configured with ``--with-storage=path``)
.. _zone_file:
file
......@@ -893,14 +903,16 @@ A path to the zone file. Non absolute path is relative to
*Default:* :ref:`storage<zone_storage>`/``%s``\ .zone
.. _zone_storage:
.. _zone_journal:
storage
journal
-------
A data directory for storing zone files, journal files and timers database.
A path to the zone journal. Non absolute path is relative to
:ref:`storage<zone_storage>`. The same set of formatters as for
:ref:`file<zone_file>` is supported.
*Default:* ``${localstatedir}/lib/knot`` (configured with ``--with-storage=path``)
*Default:* :ref:`storage<zone_storage>`/``%s``\ .db
.. _zone_master:
......
......@@ -1062,7 +1062,15 @@ char* conf_journalfile_txn(
return NULL;
}
return get_filename(conf, txn, zone, "%s.db");
conf_val_t val = conf_zone_get_txn(conf, txn, C_JOURNAL, zone);
const char *journal = conf_str(&val);
// Use default journalfile name pattern if not specified.
if (journal == NULL) {
journal = "%s.db";
}
return get_filename(conf, txn, zone, journal);
}
size_t conf_udp_threads_txn(
......
......@@ -216,8 +216,9 @@ static const yp_item_t desc_remote[] = {
};
#define ZONE_ITEMS(FLAGS) \
{ C_FILE, YP_TSTR, YP_VNONE, FLAGS }, \
{ C_STORAGE, YP_TSTR, YP_VSTR = { STORAGE_DIR }, FLAGS }, \
{ C_FILE, YP_TSTR, YP_VNONE, FLAGS }, \
{ C_JOURNAL, YP_TSTR, YP_VNONE, FLAGS }, \
{ C_MASTER, YP_TREF, YP_VREF = { C_RMT }, YP_FMULTI, { check_ref } }, \
{ C_DDNS_MASTER, YP_TREF, YP_VREF = { C_RMT }, YP_FNONE, { check_ref } }, \
{ C_NOTIFY, YP_TREF, YP_VREF = { C_RMT }, YP_FMULTI, { check_ref } }, \
......
......@@ -52,6 +52,7 @@
#define C_IDENT "\x08""identity"
#define C_INCL "\x07""include"
#define C_IXFR_DIFF "\x15""ixfr-from-differences"
#define C_JOURNAL "\x07""journal"
#define C_KASP_DB "\x07""kasp-db"
#define C_KEY "\x03""key"
#define C_KEYSTORE "\x08""keystore"
......
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