Updated Branches:
  refs/heads/master 52ce5d251 -> 730320977

TS-2203: better syslog startup messages

Utility programs don't need to syslog to tell us they are running.
Server programs now syslog with their program name so that operators
know what is being referred to.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/73032097
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/73032097
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/73032097

Branch: refs/heads/master
Commit: 730320977d8b2007ed25c31ff751fa07ee470abf
Parents: 52ce5d2
Author: James Peach <[email protected]>
Authored: Mon Dec 16 10:40:12 2013 -0800
Committer: James Peach <[email protected]>
Committed: Mon Dec 16 15:59:49 2013 -0800

----------------------------------------------------------------------
 CHANGES                        |  2 ++
 proxy/Main.cc                  |  6 +++---
 proxy/Main.h                   |  1 -
 proxy/logging/LogStandalone.cc | 14 ++++++++------
 4 files changed, 13 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/73032097/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 2bd9fd7..a0f5bb6 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-2203] Clarify syslog startup messages for standalone log programs.
+
   *) [TS-2436] Add a simple integration test harness.
 
   *) [TS-2355] ATS 4.0.x crashes when using OpenSSL 1.0.1e

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/73032097/proxy/Main.cc
----------------------------------------------------------------------
diff --git a/proxy/Main.cc b/proxy/Main.cc
index b03465b..eb78e37 100644
--- a/proxy/Main.cc
+++ b/proxy/Main.cc
@@ -220,7 +220,7 @@ static const ArgumentDescription argument_descriptions[] = {
 //
 // Initialize operating system related information/services
 //
-void
+static void
 init_system()
 {
   RecInt stackDump;
@@ -233,8 +233,8 @@ init_system()
 
   init_signals(stackDump == 1);
 
-  syslog(LOG_NOTICE, "NOTE: --- Server Starting ---");
-  syslog(LOG_NOTICE, "NOTE: Server Version: %s", 
appVersionInfo.FullVersionInfoStr);
+  syslog(LOG_NOTICE, "NOTE: --- %s Starting ---", appVersion.AppStr);
+  syslog(LOG_NOTICE, "NOTE: %s Version: %s", appVersion.AppStr, 
appVersionInfo.FullVersionInfoStr);
 
   //
   // Delimit file Descriptors

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/73032097/proxy/Main.h
----------------------------------------------------------------------
diff --git a/proxy/Main.h b/proxy/Main.h
index 363fffc..a8a2cd8 100644
--- a/proxy/Main.h
+++ b/proxy/Main.h
@@ -70,7 +70,6 @@ extern int default_rcvbuf_size;
 //
 // Functions
 //
-void init_system();
 void shutdown_system();
 inline bool
 maintainance_mode()

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/73032097/proxy/logging/LogStandalone.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogStandalone.cc b/proxy/logging/LogStandalone.cc
index 931a254..c60d703 100644
--- a/proxy/logging/LogStandalone.cc
+++ b/proxy/logging/LogStandalone.cc
@@ -72,14 +72,16 @@ AppVersionInfo appVersionInfo;
   init_system
   -------------------------------------------------------------------------*/
 
-void
-init_system()
+static void
+init_system(bool notify_syslog)
 {
   fds_limit = ink_max_out_rlimit(RLIMIT_NOFILE, true, false);
 
   init_signals();
-  syslog(LOG_NOTICE, "NOTE: --- SAC Starting ---");
-  syslog(LOG_NOTICE, "NOTE: SAC Version: %s", 
appVersionInfo.FullVersionInfoStr);
+  if (notify_syslog) {
+    syslog(LOG_NOTICE, "NOTE: --- %s Starting ---", appVersionInfo.AppStr);
+    syslog(LOG_NOTICE, "NOTE: %s Version: %s", appVersionInfo.AppStr, 
appVersionInfo.FullVersionInfoStr);
+  }
 }
 
 /*-------------------------------------------------------------------------
@@ -215,7 +217,7 @@ init_log_standalone(const char *pgm_name, bool one_copy)
 
   openlog(pgm_name, LOG_PID | LOG_NDELAY | LOG_NOWAIT, LOG_DAEMON);
 
-  init_system();
+  init_system(true);
   initialize_process_manager();
   diagsConfig = NEW(new DiagsConfig(logfile, error_tags, action_tags));
   diags = diagsConfig->diags;
@@ -244,7 +246,7 @@ init_log_standalone_basic(const char *pgm_name)
   snprintf(logfile, sizeof(logfile), "%s.log", pgm_name);
   openlog(pgm_name, LOG_PID | LOG_NDELAY | LOG_NOWAIT, LOG_DAEMON);
 
-  init_system();
+  init_system(false);
   const bool use_records = false;
   diagsConfig = NEW(new DiagsConfig(logfile, error_tags, action_tags, 
use_records));
   diags = diagsConfig->diags;

Reply via email to