From bc163b33fc3d03a4a39d6ba5e6236bbe778a7956 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Mon, 23 May 2016 20:06:29 -0500 Subject: [PATCH 1/3] move multiserver message to once during startup only --- scripts/zmpkg.pl.in | 7 ++++++- src/zm_config.cpp | 5 ----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/zmpkg.pl.in b/scripts/zmpkg.pl.in index 57708c62a..42de011fe 100644 --- a/scripts/zmpkg.pl.in +++ b/scripts/zmpkg.pl.in @@ -226,7 +226,12 @@ if ( $command =~ /^(?:start|restart)$/ ) zmMemTidy(); runCommand( "zmdc.pl startup" ); - Info( "Starting up services" . ( $Config{ZM_SERVER_ID} ? " for server $Config{ZM_SERVER_ID}\n" : "\n" ) ); + if ( $Config{ZM_SERVER_ID} ) { + Info( "Multi-server configuration detected. Starting up services for server $Config{ZM_SERVER_ID}\n"); + } else { + Info( "Single server configuration detected. Starting up services." ); + } + my $sql = $Config{ZM_SERVER_ID} ? 'SELECT * FROM Monitors WHERE ServerId=?' : 'SELECT * FROM Monitors'; my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); diff --git a/src/zm_config.cpp b/src/zm_config.cpp index 26051f113..4859e4bb8 100644 --- a/src/zm_config.cpp +++ b/src/zm_config.cpp @@ -135,11 +135,6 @@ void zmLoadConfig() } } - if ( ! staticConfig.SERVER_ID ) { - Debug( 1, "No Server ID or Name specified in config. Not using Multi-Server Mode." ); - } else { - Debug( 1, "Server is %d: using Multi-Server Mode.", staticConfig.SERVER_ID ); - } } StaticConfig staticConfig; From 6e82f2c9a916c88c016272ff20794ecdbd7e14b9 Mon Sep 17 00:00:00 2001 From: Andy Bauer Date: Tue, 24 May 2016 08:50:09 -0500 Subject: [PATCH 2/3] add messages back with debug 3 --- src/zm_config.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/zm_config.cpp b/src/zm_config.cpp index 4859e4bb8..347115421 100644 --- a/src/zm_config.cpp +++ b/src/zm_config.cpp @@ -133,8 +133,11 @@ void zmLoadConfig() } else { Fatal("Can't get ServerName for Server ID %d", staticConfig.SERVER_ID ); } - - } + if ( staticConfig.SERVER_ID ) { + Debug( 3, "Multi-server configuration detected. Server is %d.", staticConfig.SERVER_ID ); + } else { + Debug( 3, "Single server configuration assumed because no Server ID or Name was specified." ); + } } StaticConfig staticConfig; From d12b9dc16da0b8ea29a5d5b9ca7819b7a4da8726 Mon Sep 17 00:00:00 2001 From: Andy Bauer Date: Tue, 24 May 2016 09:24:18 -0500 Subject: [PATCH 3/3] fix typo. needs } --- src/zm_config.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/zm_config.cpp b/src/zm_config.cpp index 347115421..c08b65e56 100644 --- a/src/zm_config.cpp +++ b/src/zm_config.cpp @@ -133,10 +133,11 @@ void zmLoadConfig() } else { Fatal("Can't get ServerName for Server ID %d", staticConfig.SERVER_ID ); } - if ( staticConfig.SERVER_ID ) { - Debug( 3, "Multi-server configuration detected. Server is %d.", staticConfig.SERVER_ID ); - } else { - Debug( 3, "Single server configuration assumed because no Server ID or Name was specified." ); + if ( staticConfig.SERVER_ID ) { + Debug( 3, "Multi-server configuration detected. Server is %d.", staticConfig.SERVER_ID ); + } else { + Debug( 3, "Single server configuration assumed because no Server ID or Name was specified." ); + } } }