From bf1aec970e9ac0600266fe7a045847a62f18ac3b Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Fri, 19 Jun 2009 23:49:34 +0200 Subject: Adds support for soft reconfiguration. --- sysdep/unix/config.Y | 9 +++++++-- sysdep/unix/main.c | 8 ++++---- sysdep/unix/unix.h | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) (limited to 'sysdep/unix') diff --git a/sysdep/unix/config.Y b/sysdep/unix/config.Y index 5176be6..1917fe6 100644 --- a/sysdep/unix/config.Y +++ b/sysdep/unix/config.Y @@ -13,7 +13,7 @@ CF_HDR CF_DECLS -CF_KEYWORDS(LOG, SYSLOG, ALL, DEBUG, TRACE, INFO, REMOTE, WARNING, ERROR, AUTH, FATAL, BUG, STDERR) +CF_KEYWORDS(LOG, SYSLOG, ALL, DEBUG, TRACE, INFO, REMOTE, WARNING, ERROR, AUTH, FATAL, BUG, STDERR, SOFT) %type log_mask log_mask_list log_cat %type log_file @@ -65,8 +65,13 @@ log_cat: /* Unix specific commands */ +CF_CLI_HELP(CONFIGURE, [soft] [\"\"], [[Reload configuration]]) + CF_CLI(CONFIGURE, cfg_name, [\"\"], [[Reload configuration]]) -{ cmd_reconfig($2); } ; +{ cmd_reconfig($2, RECONFIG_HARD); } ; + +CF_CLI(CONFIGURE SOFT, cfg_name, [\"\"], [[Reload configuration and ignore changes in filters]]) +{ cmd_reconfig($3, RECONFIG_SOFT); } ; CF_CLI(DOWN,,, [[Shut the daemon down]]) { cli_msg(7, "Shutdown requested"); order_shutdown(); } ; diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c index 4df4e9f..5f5b165 100644 --- a/sysdep/unix/main.c +++ b/sysdep/unix/main.c @@ -115,7 +115,7 @@ read_config(void) else die("Unable to open configuration file %s: %m", config_name); } - config_commit(conf); + config_commit(conf, RECONFIG_HARD); } void @@ -133,11 +133,11 @@ async_config(void) config_free(conf); } else - config_commit(conf); + config_commit(conf, RECONFIG_HARD); } void -cmd_reconfig(char *name) +cmd_reconfig(char *name, int type) { struct config *conf; @@ -154,7 +154,7 @@ cmd_reconfig(char *name) } else { - switch (config_commit(conf)) + switch (config_commit(conf, type)) { case CONF_DONE: cli_msg(3, "Reconfigured."); diff --git a/sysdep/unix/unix.h b/sysdep/unix/unix.h index 997a408..83f61af 100644 --- a/sysdep/unix/unix.h +++ b/sysdep/unix/unix.h @@ -16,7 +16,7 @@ struct pool; void async_config(void); void async_dump(void); void async_shutdown(void); -void cmd_reconfig(char *name); +void cmd_reconfig(char *name, int type); /* io.c */ -- cgit v1.2.3