Reload strongswan.conf and plugins supporting reloading on SIGHUP
authorMartin Willi <martin@revosec.ch>
Tue, 12 Apr 2011 09:20:25 +0000 (11:20 +0200)
committerMartin Willi <martin@revosec.ch>
Fri, 15 Apr 2011 08:07:13 +0000 (10:07 +0200)
src/charon/charon.c

index d1fff5b..dda09f6 100644 (file)
@@ -109,7 +109,16 @@ static void run()
                {
                        case SIGHUP:
                        {
-                               DBG1(DBG_DMN, "signal of type SIGHUP received. Ignored");
+                               DBG1(DBG_DMN, "signal of type SIGHUP received. Reloading "
+                                        "configuration");
+                               if (lib->settings->load_files(lib->settings, NULL, FALSE))
+                               {
+                                       lib->plugins->reload(lib->plugins, NULL);
+                               }
+                               else
+                               {
+                                       DBG1(DBG_DMN, "reloading config failed, keeping old");
+                               }
                                break;
                        }
                        case SIGINT: