diff options
Diffstat (limited to 'sysdep/unix/main.c')
-rw-r--r-- | sysdep/unix/main.c | 37 |
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 */ |