summaryrefslogtreecommitdiff
path: root/conf/conf.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2019-07-03 11:09:52 +0200
committerMaria Matejka <mq@ucw.cz>2019-07-03 11:12:25 +0200
commiteac9250fd5b10809830361b94438339b3b31b270 (patch)
tree5c9ec2591f0baa462f5572f83e4c452c3a166c95 /conf/conf.c
parent8816b6cdd98d24535eece6b5e35730aac57cd9f7 (diff)
parent026bfedb332d8c0dde28c693c177fe993b5df26d (diff)
Merge branch 'master' into mq-filter-stack
Diffstat (limited to 'conf/conf.c')
-rw-r--r--conf/conf.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/conf/conf.c b/conf/conf.c
index b0980d7e..b21d5213 100644
--- a/conf/conf.c
+++ b/conf/conf.c
@@ -447,6 +447,24 @@ config_undo(void)
return CONF_PROGRESS;
}
+int
+config_status(void)
+{
+ if (shutting_down)
+ return CONF_SHUTDOWN;
+
+ if (configuring)
+ return future_cftype ? CONF_QUEUED : CONF_PROGRESS;
+
+ return CONF_DONE;
+}
+
+btime
+config_timer_status(void)
+{
+ return tm_active(config_timer) ? tm_remains(config_timer) : -1;
+}
+
extern void cmd_reconfig_undo_notify(void);
static void
@@ -477,19 +495,24 @@ config_init(void)
* for switching to an empty configuration.
*/
void
-order_shutdown(void)
+order_shutdown(int gr)
{
struct config *c;
if (shutting_down)
return;
- log(L_INFO "Shutting down");
+ if (!gr)
+ log(L_INFO "Shutting down");
+ else
+ log(L_INFO "Shutting down for graceful restart");
+
c = lp_alloc(config->mem, sizeof(struct config));
memcpy(c, config, sizeof(struct config));
init_list(&c->protos);
init_list(&c->tables);
c->shutdown = 1;
+ c->gr_down = gr;
config_commit(c, RECONFIG_HARD, 0);
shutting_down = 1;