Commit 036614f8 authored by Daniel Salzman's avatar Daniel Salzman

Update doc, man and help

parent 6ccd504b
......@@ -14,8 +14,9 @@ there are no differences and you can control it just the same way.
Usage: knotd [parameters]
Parameters:
-c, --config [file] Select configuration file.
-d, --daemonize [dir] Run server as a daemon. Working directory may be set.
-c, --config <file> Select configuration file.
-d, --daemonize=[dir] Run server as a daemon. Working directory may
be set.
-v, --verbose Verbose mode - additional runtime information.
-V, --version Print version of the server.
-h, --help Print help and usage.
......@@ -35,32 +36,29 @@ If you want to control the daemon directly, use @code{SIGINT} to quit the proces
Usage: knotc [parameters] <action> [action_args]
Parameters:
-c [file], --config=[file] Select configuration file.
-s [server] Remote UNIX socket/IP address
(default $@{rundir@}/knot.sock).
-p [port] Remote server port (only for IP).
-y [[hmac:]name:key] Use key_id specified on the command line.
-k [file] Use key file (as in config section 'keys').
Example:
echo "knotc-key hmac-md5 Wg==" > knotc.key
-f, --force Force operation - override some checks.
-v, --verbose Verbose mode - additional runtime
information.
-V, --version Print knot server version.
-i, --interactive Interactive mode (do not daemonize).
-h, --help Print help and usage.
-c, --config <file> Select configuration file.
-s <server> Remote UNIX socket/IP address (default
$@{rundir@}/knot.sock).
-p <port> Remote server port (only for IP).
-y <[hmac:]name:key> Use key specified on the command line.
-k <file> Use key file (as in config section 'keys').
-f, --force Force operation - override some checks.
-v, --verbose Verbose mode - additional runtime information.
-V, --version Print knot server version.
-i, --interactive Interactive mode (do not daemonize).
-h, --help Print help and usage.
Actions:
stop Stop server.
reload Reload configuration and changed zones.
refresh [zone] Refresh slave zone (all if not specified).
flush Flush journal and update zone files.
status Check if server is running.
zonestatus Show status of configured zones.
checkconf Check current server configuration.
checkzone [zone] Check zone (all if not specified).
memstats [zone] Estimate memory consumption for zone
(all if not specified).
stop Stop server.
reload Reload configuration and changed zones.
refresh [zone] Refresh slave zone (all if not specified).
flush Flush journal and update zone files.
status Check if server is running.
zonestatus Show status of configured zones.
checkconf Check current server configuration.
checkzone [zone] Check zone (all if not specified).
memstats [zone] Estimate memory consumption for zone (all if not
specified).
@end example
Also, the server needs to create several files in order to run properly. These
......
......@@ -4,21 +4,25 @@
\- Knot DNS control utility
.SH SYNOPSIS
.B knotc
[\fIparameters\fR] \fI<action>\fR [\fIaction_args\fR]
[\fIparameters\fR] \fIaction\fR [\fIaction_args\fR]
.SH DESCRIPTION
.SS "Parameters:"
.HP
\fB\-c\fR [file], \fB\-\-config\fR=\fI[file]\fR Select configuration file.
.TP
\fB\-s\fR [server]\fR Remote UNIX socket/IP address (default @run_dir@/knot.sock)
\fB\-c\fR, \fB\-\-config\fR \fIfile\fR
Select configuration file.
.TP
\fB\-p\fR [port]\fR Remote server port (only for IP).
\fB\-s\fR \fIserver\fR
Remote UNIX socket/IP address (default @run_dir@/knot.sock).
.TP
\fB\-y\fR [hmac:]name:key]\fR Use key_id for specified on the command line.
\fB\-p\fR \fIport\fR
Remote server port (only for IP).
.TP
\fB\-k\fR [file]\fR Use key file (as in config section 'keys').
f.e. echo "knotc\-key hmac\-md5 Wg==" > knotc.key
If you omit algorithm, hmac\-md5 will be used as default.
\fB\-y\fR [\fIhmac\fR:]\fIname\fR:\fIkey\fR
Use key specified on the command line.
.TP
\fB\-k\fR \fIfile\fR
Use key file (as in config section 'keys').
(default algorithm is hmac\-md5).
.TP
\fB\-f\fR, \fB\-\-force\fR
Force operation \- override some checks.
......@@ -27,7 +31,7 @@ Force operation \- override some checks.
Verbose mode \- additional runtime information.
.TP
\fB\-V\fR, \fB\-\-version\fR
Print knot server version.
Print version of the server.
.TP
\fB\-i\fR, \fB\-\-interactive\fR
Interactive mode (do not daemonize).
......@@ -36,57 +40,53 @@ Interactive mode (do not daemonize).
Print help and usage.
.SS "Actions:"
.TP
stop
Stop knot server daemon (no\-op if not running).
\fBstop\fR
Stop server (no\-op if not running).
.TP
reload
Reload knot configuration and zones.
\fBreload\fR
Reload configuration and changed zones.
.TP
flush
\fBflush\fR
Flush journal and update zone files.
.TP
status
\fBstatus\fR
Check if server is running.
.TP
zonestatus
\fBzonestatus\fR
Show status of configured zones.
.TP
refresh
\fBrefresh\fR [\fIzone\fR]...
Refresh slave zones (all if not specified).
.TP
checkconf
Check server configuration.
\fBcheckconf\fR
Check current server configuration.
.TP
checkzone
Check zones before compiling (accepts specific zones, f.e. 'knotc checkzone example1.com example2.com').
\fBcheckzone\fR [\fIzone\fR]...
Check zone (all if not specified).
.TP
memstats
Estimate memory consumption for zone files. Useful mainly for big zones.
.SS "EXAMPLES"
\fBmemstats\fR [\fIzone\fR]...
Estimate memory consumption for zone (all if not specified).
.SH EXAMPLES
.TP
.B Setup a keyfile for remote control
.TP
1. Generate keys
dnssec\-keygen \-a hmac\-md5 \-b 256 \-n HOST knotc\-key
1. Generate key:
.TP
# dnssec\-keygen \-a hmac\-md5 \-b 256 \-n HOST knotc\-key
.TP
2. Extract secret in base64 format and create keyfile:
.TP
2. Extract secret in base64 format and create keyfile
echo "knotc\-key hmac\-md5 <secret>" > knotc.key
Make sure the key can be read/written only by owner for
security reasons.
# echo "knotc\-key hmac\-md5 <secret>" > knotc.key
.TP
Make sure the key can be read/written only by the owner for security reasons.
.TP
.B Reload server remotely
knotc \-s 127.0.0.1 \-k knotc.key reload
.TP
# knotc \-s 127.0.0.1 \-k knotc.key reload
.SH "SEE ALSO"
The full documentation for
.B Knot
is maintained as a Texinfo manual. If the
.B info
and
.B Knot
programs are properly installed at your site, the command
.IP
.B info Knot
.PP
should give you access to the complete manual.
.BR knotd (8)
.SH NOTE
The full documentation for \fBKnot DNS\fR is maintained
as a Texinfo manual. If the \fBinfo\fR program is properly
installed at your site, the \fBinfo\ Knot\fR command should
give you an access to the complete manual.
.TH "knotd" "8" "@RELEASE_DATE@" "CZ.NIC Labs" "Knot DNS, version @VERSION@"
.SH NAME
.B knotd
\- Knot DNS daemon
\- Knot DNS server daemon
.SH SYNOPSIS
.B knotd
[\fIparameters\fR]
.SH DESCRIPTION
.SS "Parameters:"
.HP
\fB\-c\fR, \fB\-\-config\fR [file] Select configuration file.
.TP
\fB\-d\fR, \fB\-\-daemonize\fR
Run server as a daemon.
\fB\-c\fR, \fB\-\-config\fR \fIfile\fR
Select configuration file.
.TP
\fB\-d\fR, \fB\-\-daemonize\fR=[\fIdir\fR]
Run server as a daemon. Working directory may be set.
.TP
\fB\-v\fR, \fB\-\-verbose\fR
Verbose mode \- additional runtime information.
......@@ -22,14 +23,9 @@ Print version of the server.
\fB\-h\fR, \fB\-\-help\fR
Print help and usage.
.SH "SEE ALSO"
The full documentation for
.B Knot
is maintained as a Texinfo manual. If the
.B info
and
.B Knot
programs are properly installed at your site, the command
.IP
.B info Knot
.PP
should give you access to the complete manual.
.BR knotc (8)
.SH NOTE
The full documentation for \fBKnot DNS\fR is maintained
as a Texinfo manual. If the \fBinfo\fR program is properly
installed at your site, the \fBinfo\ Knot\fR command should
give you an access to the complete manual.
......@@ -91,7 +91,7 @@ knot_cmd_t knot_cmd_tbl[] = {
{&cmd_zonestatus, 0, "zonestatus", "", "\tShow status of configured zones."},
{&cmd_checkconf, 1, "checkconf", "", "\tCheck current server configuration."},
{&cmd_checkzone, 1, "checkzone", "[zone]", "Check zone (all if not specified)."},
{&cmd_memstats, 1, "memstats", "[zone]", "Estimate memory use for zone (all if not specified)."},
{&cmd_memstats, 1, "memstats", "[zone]", "Estimate memory use for zone (all if not specified)."},
{&cmd_signzone, 0, "signzone", "[zone]", "Sign all zones with available DNSSEC keys."},
{NULL, 0, NULL, NULL, NULL}
};
......@@ -101,17 +101,16 @@ void help(void)
{
printf("Usage: %sc [parameters] <action>\n", PACKAGE_NAME);
printf("\nParameters:\n"
" -c [file], --config=[file]\tSelect configuration file.\n"
" -s [server] \tRemote UNIX socket/IP address (default %s).\n"
" -p [port] \tRemote server port (only for IP).\n"
" -y [[hmac:]name:key] \tUse key_id specified on the command line.\n"
" -k [file] \tUse key file (as in config section 'keys').\n"
" \t Example: echo \"knotc-key hmac-md5 Wg==\" > knotc.key\n"
" -f, --force \tForce operation - override some checks.\n"
" -v, --verbose \tVerbose mode - additional runtime information.\n"
" -V, --version \tPrint %s server version.\n"
" -i, --interactive \tInteractive mode (do not daemonize).\n"
" -h, --help \tPrint help and usage.\n",
" -c, --config <file> \tSelect configuration file.\n"
" -s <server> \tRemote UNIX socket/IP address (default %s).\n"
" -p <port> \tRemote server port (only for IP).\n"
" -y <[hmac:]name:key> \tUse key specified on the command line.\n"
" -k <file> \tUse key file (as in config section 'keys').\n"
" -f, --force \tForce operation - override some checks.\n"
" -v, --verbose \tVerbose mode - additional runtime information.\n"
" -V, --version \tPrint %s server version.\n"
" -i, --interactive \tInteractive mode (do not daemonize).\n"
" -h, --help \tPrint help and usage.\n",
RUN_DIR "/knot.sock", PACKAGE_NAME);
printf("\nActions:\n");
knot_cmd_t *c = knot_cmd_tbl;
......
......@@ -94,12 +94,12 @@ void help(void)
printf("Usage: %sd [parameters]\n",
PACKAGE_NAME);
printf("\nParameters:\n"
" -c, --config [file] Select configuration file.\n"
" -c, --config <file> Select configuration file.\n"
#ifdef INTEGRITY_CHECK
" -z, --zone [zone] Set zone to check. Send SIGUSR1 to trigger\n"
" -z, --zone <zone> Set zone to check. Send SIGUSR1 to trigger\n"
" integrity check.\n"
#endif /* INTEGRITY_CHECK */
" -d, --daemonize [root] Run server as a daemon.\n"
" -d, --daemonize=[dir] Run server as a daemon.\n"
" -v, --verbose Verbose mode - additional runtime information.\n"
" -V, --version Print version of the server.\n"
" -h, --help Print help and usage.\n");
......@@ -122,7 +122,7 @@ int main(int argc, char **argv)
#ifdef INTEGRITY_CHECK
{"zone", required_argument, 0, 'z'},
#endif /* INTEGRITY_CHECK */
{"daemonize", optional_argument, 0, 'd'},
{"daemonize", optional_argument, 0, 'd'},
{"verbose", no_argument, 0, 'v'},
{"version", no_argument, 0, 'V'},
{"help", no_argument, 0, 'h'},
......@@ -321,14 +321,17 @@ int main(int argc, char **argv)
cwd[0] = '\0';
}
}
if (!daemon_root) {
daemon_root = "/";
if (daemon_root == NULL) {
daemon_root = strdup("/");
}
if (chdir(daemon_root) != 0) {
log_server_warning("Server can't change working directory to %s.\n", daemon_root);
log_server_warning("Server can't change working "
"directory to %s.\n", daemon_root);
} else {
log_server_info("Server changed directory to %s.\n", daemon_root);
log_server_info("Server changed directory to %s.\n",
daemon_root);
}
free(daemon_root);
} else {
log_server_info("Server started in foreground, PID = %ld\n", pid);
log_server_info("Server running without PID file.\n");
......
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