summaryrefslogtreecommitdiffstats
path: root/sysdep
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2000-01-16 18:40:26 +0100
committerMartin Mares <mj@ucw.cz>2000-01-16 18:40:26 +0100
commitbf8558bc9cab35f31bccd6a55e51f121370765c4 (patch)
treebf5396b1e4f7a9c2eff282a5f675e0cb59d1704e /sysdep
parentebc793a5f552bb676014f771d81c074b7dd4345d (diff)
downloadbird-bf8558bc9cab35f31bccd6a55e51f121370765c4.tar
bird-bf8558bc9cab35f31bccd6a55e51f121370765c4.zip
Converted shutdown to a kind of reconfiguration, it's no more handled
as a exception in protocol state machines. Introduced a `shutdown' CLI command. Killed few reconfiguration bugs.
Diffstat (limited to 'sysdep')
-rw-r--r--sysdep/unix/config.Y3
-rw-r--r--sysdep/unix/main.c10
2 files changed, 8 insertions, 5 deletions
diff --git a/sysdep/unix/config.Y b/sysdep/unix/config.Y
index 299cc41..cd553f8 100644
--- a/sysdep/unix/config.Y
+++ b/sysdep/unix/config.Y
@@ -67,6 +67,9 @@ log_cat:
CF_CLI(CONFIGURE, cfg_name, [<file>], [[Reload configuration]])
{ cmd_reconfig($2); } ;
+CF_CLI(SHUTDOWN,,, [[Shut the daemon down]])
+{ cli_msg(7, "Shutdown ordered"); order_shutdown(); } ;
+
cfg_name:
/* empty */ { $$ = NULL; }
| TEXT
diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c
index 97b9dc6..5019a3d 100644
--- a/sysdep/unix/main.c
+++ b/sysdep/unix/main.c
@@ -29,8 +29,6 @@
#include "unix.h"
#include "krt.h"
-int shutting_down;
-
/*
* Debugging
*/
@@ -153,6 +151,9 @@ cmd_reconfig(char *name)
case CONF_PROGRESS:
cli_msg(4, "Reconfiguration in progress.");
break;
+ case CONF_SHUTDOWN:
+ cli_msg(6, "Reconfiguration ignored, shutting down.");
+ break;
default:
cli_msg(5, "Reconfiguration already in progress, queueing new config");
}
@@ -275,12 +276,11 @@ void
async_shutdown(void)
{
debug("Shutting down...\n");
- shutting_down = 1;
- protos_shutdown();
+ order_shutdown();
}
void
-protos_shutdown_notify(void)
+sysdep_shutdown_done(void)
{
unlink(PATH_CONTROL_SOCKET);
die("System shutdown completed");