File reload_config.patch of Package ZoneMinder
From aeb83d12edcdff979001ad79faecd111e9f5630a Mon Sep 17 00:00:00 2001
From: Dirk Hartmann <2monex@gmx.net>
Date: Thu, 3 Apr 2014 20:13:44 +0200
Subject: [PATCH 4/7] reload_config.patch
---
scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in | 10 +++++++---
scripts/zmpkg.pl.in | 3 +++
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in b/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in
index 7f38d2c6e..a10391722 100644
--- a/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in
+++ b/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in
@@ -70,8 +70,8 @@ use constant ZM_CONFIG_SUBDIR => "@ZM_CONFIG_SUBDIR@"; # Path to the ZoneMinder
use Carp;
# Load the config from the database into the symbol table
-BEGIN {
-
+sub load_configuration
+{
# Process name, value pairs from the main config file first
my $config_file = ZM_CONFIG;
process_configfile($config_file);
@@ -163,7 +163,7 @@ BEGIN {
}
}
-} # end BEGIN
+} # end load_configuration
sub loadConfigFromDB {
print( 'Loading config from DB' );
@@ -267,6 +267,10 @@ sub saveConfigToDB {
$dbh->{AutoCommit} = $ac;
} # end sub saveConfigToDB
+BEGIN
+{
+ load_configuration();
+} # end BEGIN
1;
__END__
diff --git a/scripts/zmpkg.pl.in b/scripts/zmpkg.pl.in
index f636007c5..781b49bbf 100644
--- a/scripts/zmpkg.pl.in
+++ b/scripts/zmpkg.pl.in
@@ -178,6 +178,9 @@ if ( $command =~ /^(?:start|restart)$/ ) {
Debug("zmdc.pl check = $status");
if ( $status eq 'stopped' ) {
+
+ ZoneMinder::Config::load_configuration();
+
if ( $Config{ZM_DYN_DB_VERSION}
and ( $Config{ZM_DYN_DB_VERSION} ne ZM_VERSION )
) {
--
2.18.0