From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16113 invoked by alias); 20 Jun 2008 06:45:07 -0000 Received: (qmail 16006 invoked by uid 9702); 20 Jun 2008 06:45:05 -0000 Date: Fri, 20 Jun 2008 06:45:00 -0000 Message-ID: <20080620064505.15991.qmail@sourceware.org> From: fabbione@sourceware.org To: cluster-cvs@sources.redhat.com, cluster-devel@redhat.com Subject: Cluster Project branch, master, updated. cluster-2.99.04-40-g41356bd X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 2a62bccc8a9ec72bcb6cb6c75583eb55d2af9433 X-Git-Newrev: 41356bd6b4322fd3029e32fea317063bb9a4e543 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2008-q2/txt/msg00513.txt.bz2 This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Cluster Project". http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=41356bd6b4322fd3029e32fea317063bb9a4e543 The branch, master has been updated via 41356bd6b4322fd3029e32fea317063bb9a4e543 (commit) from 2a62bccc8a9ec72bcb6cb6c75583eb55d2af9433 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 41356bd6b4322fd3029e32fea317063bb9a4e543 Author: Fabio M. Di Nitto Date: Fri Jun 20 08:43:31 2008 +0200 [CCS] Improve logsys init order If we can init and config from a real config file, do that and start logging immediatly. If we cannot, fall back to default and start logging. Signed-off-by: Fabio M. Di Nitto ----------------------------------------------------------------------- Summary of changes: ccs/daemon/ccsd.c | 10 +++++++++- ccs/daemon/misc.c | 10 ++++++++++ 2 files changed, 19 insertions(+), 1 deletions(-) diff --git a/ccs/daemon/ccsd.c b/ccs/daemon/ccsd.c index c4d36b8..12ad2e7 100644 --- a/ccs/daemon/ccsd.c +++ b/ccs/daemon/ccsd.c @@ -58,6 +58,7 @@ int main(int argc, char *argv[]){ int addr_size=0; fd_set rset, tmp_set; char *msg; + unsigned int logmode; msg = parse_cli_args(argc, argv); @@ -72,7 +73,14 @@ int main(int argc, char *argv[]){ exit(EXIT_FAILURE); } - logsys_config_mode_set (LOG_MODE_OUTPUT_STDERR | LOG_MODE_OUTPUT_SYSLOG_THREADED | LOG_MODE_OUTPUT_FILE | LOG_MODE_FLUSH_AFTER_CONFIG); + logmode = logsys_config_mode_get(); + + if(logmode & LOG_MODE_BUFFER_BEFORE_CONFIG) { + log_printf(LOG_INFO, "Using default CCS logsys config options\n"); + logmode &= ~LOG_MODE_BUFFER_BEFORE_CONFIG; + logmode |= LOG_MODE_FLUSH_AFTER_CONFIG; + logsys_config_mode_set (logmode); + } daemonize(); diff --git a/ccs/daemon/misc.c b/ccs/daemon/misc.c index 13f5780..b372e81 100644 --- a/ccs/daemon/misc.c +++ b/ccs/daemon/misc.c @@ -154,6 +154,7 @@ int set_ccs_logging(xmlDocPtr ldoc){ int facility = SYSLOGFACILITY, loglevel = LOG_LEVEL_INFO; char *res = NULL; xmlXPathContextPtr ctx = NULL; + unsigned int logmode; CCSENTER("set_ccs_logging"); @@ -193,6 +194,15 @@ int set_ccs_logging(xmlDocPtr ldoc){ xmlXPathFreeContext(ctx); } + logmode = logsys_config_mode_get(); + + if(logmode & LOG_MODE_BUFFER_BEFORE_CONFIG) { + log_printf(LOG_INFO, "CCS logsys config enabled from set_ccs_logging\n"); + logmode &= ~LOG_MODE_BUFFER_BEFORE_CONFIG; + logmode |= LOG_MODE_FLUSH_AFTER_CONFIG; + logsys_config_mode_set (logmode); + } + CCSEXIT("set_ccs_logging"); return 0; } hooks/post-receive -- Cluster Project