summaryrefslogtreecommitdiff
path: root/sysdep/unix/main.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 /sysdep/unix/main.c
parent8816b6cdd98d24535eece6b5e35730aac57cd9f7 (diff)
parent026bfedb332d8c0dde28c693c177fe993b5df26d (diff)
Merge branch 'master' into mq-filter-stack
Diffstat (limited to 'sysdep/unix/main.c')
-rw-r--r--sysdep/unix/main.c37
1 files changed, 35 insertions, 2 deletions
diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c
index b0d764fa..05becbe7 100644
--- a/sysdep/unix/main.c
+++ b/sysdep/unix/main.c
@@ -338,6 +338,28 @@ cmd_reconfig_undo(void)
cmd_reconfig_msg(r);
}
+void
+cmd_reconfig_status(void)
+{
+ int s = config_status();
+ btime t = config_timer_status();
+
+ switch (s)
+ {
+ case CONF_DONE: cli_msg(-3, "Daemon is up and running"); break;
+ case CONF_PROGRESS: cli_msg(-4, "Reconfiguration in progress"); break;
+ case CONF_QUEUED: cli_msg(-5, "Reconfiguration in progress, next one enqueued"); break;
+ case CONF_SHUTDOWN: cli_msg(-6, "Shutdown in progress"); break;
+ default: break;
+ }
+
+ if (t >= 0)
+ cli_msg(-22, "Configuration unconfirmed, undo in %t s", t);
+
+ cli_msg(0, "");
+}
+
+
/*
* Command-Line Interface
*/
@@ -542,14 +564,14 @@ cmd_shutdown(void)
return;
cli_msg(7, "Shutdown requested");
- order_shutdown();
+ order_shutdown(0);
}
void
async_shutdown(void)
{
DBG("Shutting down...\n");
- order_shutdown();
+ order_shutdown(0);
}
void
@@ -561,6 +583,17 @@ sysdep_shutdown_done(void)
exit(0);
}
+void
+cmd_graceful_restart(void)
+{
+ if (cli_access_restricted())
+ return;
+
+ cli_msg(25, "Graceful restart requested");
+ order_shutdown(1);
+}
+
+
/*
* Signals
*/