Commit 00cad20a authored by Jan Včelák's avatar Jan Včelák 🚀

Merge branch 'remove-knotc-restart' of /git/repositories/knot

parents 83a44abe e0e4688a
......@@ -25,7 +25,7 @@ Use knotc tool for convenience when working with the server daemon.
As of Knot DNS 1.3.0, the zones are not compiled anymore. That makes working
with the server much more user friendly.
@example
$ knotc -c knot.conf reload|restart
$ knotc -c knot.conf reload
@end example
The tool @code{knotc} is designed as a front-end for user, making it easier
......@@ -54,7 +54,6 @@ Parameters:
Actions:
stop Stop server.
restart Restart server.
reload Reload configuration and changed zones.
refresh [zone] Refresh slave zone (all if not specified).
flush Flush journal and update zone files.
......@@ -151,13 +150,6 @@ If @emph{SOA}'s @emph{serial} is not changed no differences will be created. Ple
that this feature is in @emph{experimental} stage and should be used with care.
If you encounter a bug using this feature, please send it to Knot developers (@pxref{Submitting a bugreport}).
You can also choose to tear-down the server fully and restart with the @code{knotc restart} action.
Note that some actions like start, stop and restart cannot be done remotely.
@example
$ knotc -c master.conf status # check if running
$ knotc -c master.conf restart # fully restart
@end example
If you want to force refresh the slave zones, you can do this with the @code{knotc refresh} action.
@example
$ knotc -c slave.conf refresh
......
......@@ -42,9 +42,6 @@ Print help and usage.
stop
Stop knot server daemon (no\-op if not running).
.TP
restart
Stops and then starts knot server daemon.
.TP
reload
Reload knot configuration and zones.
.TP
......
......@@ -76,7 +76,6 @@ const error_table_t knot_error_msgs[] = {
/* Control states. */
{ KNOT_CTL_STOP, "Stopping server." },
{ KNOT_CTL_RESTART, "Restarting server." },
/* Network errors. */
{ KNOT_NET_EADDR, "Bad address or host name." },
......
......@@ -95,7 +95,6 @@ enum knot_error {
/* Control states. */
KNOT_CTL_STOP, /*!< Stop requested. */
KNOT_CTL_RESTART, /*!< Restart requested. */
/* Network errors. */
KNOT_NET_EADDR,
......
......@@ -79,7 +79,6 @@ typedef struct knot_cmd {
/* Forward decls. */
static int cmd_stop(int argc, char *argv[], unsigned flags);
static int cmd_restart(int argc, char *argv[], unsigned flags);
static int cmd_reload(int argc, char *argv[], unsigned flags);
static int cmd_refresh(int argc, char *argv[], unsigned flags);
static int cmd_flush(int argc, char *argv[], unsigned flags);
......@@ -92,7 +91,6 @@ static int cmd_memstats(int argc, char *argv[], unsigned flags);
/*! \brief Table of remote commands. */
knot_cmd_t knot_cmd_tbl[] = {
{&cmd_stop, 0, "stop", "", "\t\tStop server."},
{&cmd_restart, 0, "restart", "", "\tRestart server."},
{&cmd_reload, 0, "reload", "", "\tReload configuration and changed zones."},
{&cmd_refresh, 0, "refresh", "[zone]", "\tRefresh slave zone (all if not specified)."},
{&cmd_flush, 0, "flush", "", "\t\tFlush journal and update zone files."},
......@@ -593,15 +591,6 @@ static int cmd_stop(int argc, char *argv[], unsigned flags)
return cmd_remote("stop", KNOT_RRTYPE_TXT, 0, NULL);
}
static int cmd_restart(int argc, char *argv[], unsigned flags)
{
UNUSED(argc);
UNUSED(argv);
UNUSED(flags);
return cmd_remote("restart", KNOT_RRTYPE_TXT, 0, NULL);
}
static int cmd_reload(int argc, char *argv[], unsigned flags)
{
UNUSED(argc);
......
......@@ -59,7 +59,6 @@ typedef struct remote_cmd_t {
/* Forward decls. */
static int remote_c_stop(server_t *s, remote_cmdargs_t* a);
static int remote_c_restart(server_t *s, remote_cmdargs_t* a);
static int remote_c_reload(server_t *s, remote_cmdargs_t* a);
static int remote_c_refresh(server_t *s, remote_cmdargs_t* a);
static int remote_c_status(server_t *s, remote_cmdargs_t* a);
......@@ -69,7 +68,6 @@ static int remote_c_flush(server_t *s, remote_cmdargs_t* a);
/*! \brief Table of remote commands. */
struct remote_cmd_t remote_cmd_tbl[] = {
{ "stop", &remote_c_stop },
{ "restart", &remote_c_restart },
{ "reload", &remote_c_reload },
{ "refresh", &remote_c_refresh },
{ "status", &remote_c_status },
......@@ -176,18 +174,6 @@ static int remote_c_stop(server_t *s, remote_cmdargs_t* a)
return KNOT_CTL_STOP;
}
/*!
* \brief Remote command 'restart' handler.
*
* QNAME: restart
* DATA: NULL
*/
static int remote_c_restart(server_t *s, remote_cmdargs_t* a)
{
UNUSED(a);
return KNOT_CTL_RESTART;
}
/*!
* \brief Remote command 'reload' handler.
*
......
......@@ -34,8 +34,6 @@
* Common types and constants.
*/
#define PROJECT_EXENAME "knotd"
#define PROJECT_EXEC SBINDIR "/" PROJECT_EXENAME /*!< \brief Project executable. */
#define PID_FILE "knot.pid" /*!< \brief Server PID file name. */
/*
......
......@@ -41,7 +41,6 @@
/* Signal flags. */
static volatile short sig_req_stop = 0;
static volatile short sig_req_rst = 0;
static volatile short sig_req_reload = 0;
static volatile short sig_req_refresh = 0;
static volatile short sig_stopping = 0;
......@@ -331,8 +330,6 @@ int main(int argc, char **argv)
ret = remote_process(server, conf()->ctl.iface,
remote, buf, buflen);
switch(ret) {
case KNOT_CTL_RESTART:
sig_req_rst = 1; /* Fall through */
case KNOT_CTL_STOP:
sig_req_stop = 1;
break;
......@@ -404,10 +401,6 @@ int main(int argc, char **argv)
free(cwd);
}
/* Restart hook. */
if (sig_req_rst)
return execvp(PROJECT_EXEC, argv);
return res;
}
......
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