settings: Use strongswan.conf used during library initialization for reload

Since 4b670a20 we require an explicit strongswan.conf to re-load configurations.
However, the define was missing in the build, breaking SIGHUP based config
reloading.

Fixes #651.
This commit is contained in:
Martin Willi 2014-07-17 18:07:05 +02:00
parent 9e783f6e89
commit 68da3bad57
4 changed files with 4 additions and 14 deletions

View File

@ -126,15 +126,12 @@ static int run()
{ {
DBG1(DBG_DMN, "signal of type SIGHUP received. Reloading " DBG1(DBG_DMN, "signal of type SIGHUP received. Reloading "
"configuration"); "configuration");
#ifdef STRONGSWAN_CONF if (lib->settings->load_files(lib->settings, lib->conf, FALSE))
if (lib->settings->load_files(lib->settings, STRONGSWAN_CONF,
FALSE))
{ {
charon->load_loggers(charon, levels, TRUE); charon->load_loggers(charon, levels, TRUE);
lib->plugins->reload(lib->plugins, NULL); lib->plugins->reload(lib->plugins, NULL);
} }
else else
#endif
{ {
DBG1(DBG_DMN, "reloading config failed, keeping old"); DBG1(DBG_DMN, "reloading config failed, keeping old");
} }

View File

@ -124,15 +124,12 @@ static void run()
{ {
DBG1(DBG_DMN, "signal of type SIGHUP received. Reloading " DBG1(DBG_DMN, "signal of type SIGHUP received. Reloading "
"configuration"); "configuration");
#ifdef STRONGSWAN_CONF if (lib->settings->load_files(lib->settings, lib->conf, FALSE))
if (lib->settings->load_files(lib->settings, STRONGSWAN_CONF,
FALSE))
{ {
charon->load_loggers(charon, levels, !use_syslog); charon->load_loggers(charon, levels, !use_syslog);
lib->plugins->reload(lib->plugins, NULL); lib->plugins->reload(lib->plugins, NULL);
} }
else else
#endif
{ {
DBG1(DBG_DMN, "reloading config failed, keeping old"); DBG1(DBG_DMN, "reloading config failed, keeping old");
} }
@ -468,4 +465,3 @@ deinit:
library_deinit(); library_deinit();
return status; return status;
} }

View File

@ -21,8 +21,7 @@ endif
AM_CPPFLAGS = \ AM_CPPFLAGS = \
-I$(top_srcdir)/src/libstrongswan \ -I$(top_srcdir)/src/libstrongswan \
-DIPSEC_DIR=\"${ipsecdir}\" \ -DIPSEC_DIR=\"${ipsecdir}\" \
-DPLUGINDIR=\"${plugindir}\" \ -DPLUGINDIR=\"${plugindir}\"
-DSTRONGSWAN_CONF=\"${strongswan_conf}\"
AM_LDFLAGS = \ AM_LDFLAGS = \
-no-undefined -no-undefined

View File

@ -259,13 +259,11 @@ bool settings_parser_parse_file(section_t *root, char *name)
helper->file_include(helper, name); helper->file_include(helper, name);
if (!settings_parser_open_next_file(helper)) if (!settings_parser_open_next_file(helper))
{ {
#ifdef STRONGSWAN_CONF if (lib->conf && streq(name, lib->conf))
if (streq(name, STRONGSWAN_CONF))
{ {
DBG2(DBG_CFG, "failed to open config file '%s'", name); DBG2(DBG_CFG, "failed to open config file '%s'", name);
} }
else else
#endif
{ {
DBG1(DBG_CFG, "failed to open config file '%s'", name); DBG1(DBG_CFG, "failed to open config file '%s'", name);
} }