From 9e61cf33b45d5a6d14a7aee3a0fe9a7f4cf6f41a Mon Sep 17 00:00:00 2001
From: Nigel Kukard <nkukard@lbsd.net>
Date: Sun, 12 Jan 2014 20:53:28 +0000
Subject: [PATCH] Read config while we do plugin intialization

We do this so we don't risk TC firing up first
---
 opentrafficshaper/plugins/configmanager.pm | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/opentrafficshaper/plugins/configmanager.pm b/opentrafficshaper/plugins/configmanager.pm
index ebc250f..32418d0 100644
--- a/opentrafficshaper/plugins/configmanager.pm
+++ b/opentrafficshaper/plugins/configmanager.pm
@@ -830,6 +830,13 @@ sub plugin_init
 # Start the plugin
 sub plugin_start
 {
+	# Load config
+	if (-f $config->{'statefile'}) {
+		_load_statefile();
+	} else {
+		$logger->log(LOG_WARN,"[CONFIGMANAGER] Statefile '%s' cannot be opened: %s",$config->{'statefile'},$!);
+	}
+
 	$logger->log(LOG_INFO,"[CONFIGMANAGER] Started with %s pools, %s pool members and %s overrides",
 			scalar(keys %{$pools}),
 			scalar(keys %{$poolMembers}),
@@ -848,13 +855,6 @@ sub _session_start
 	# Set our alias
 	$kernel->alias_set("configmanager");
 
-	# Load config
-	if (-f $config->{'statefile'}) {
-		_load_statefile($kernel);
-	} else {
-		$logger->log(LOG_WARN,"[CONFIGMANAGER] Statefile '%s' cannot be opened: %s",$config->{'statefile'},$!);
-	}
-
 	# Set delay on config updates
 	$kernel->delay('_tick' => TICK_PERIOD);
 
-- 
GitLab