|
From: Michael Chase-S. <mc...@us...> - 2012-02-17 22:55:02
|
Update of /cvsroot/sblim/sfcb
In directory vz-cvs-3.sog:/tmp/cvs-serv30334
Modified Files:
ChangeLog NEWS cimcClientSfcbLocal.c mlog.c mlog.h sfcBroker.c
sfcbinst2mof.c
Log Message:
[ 3488688 ] Don't spawn logger for clients
Index: sfcbinst2mof.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/sfcbinst2mof.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- sfcbinst2mof.c 9 Jan 2009 21:08:29 -0000 1.1
+++ sfcbinst2mof.c 17 Feb 2012 22:54:59 -0000 1.2
@@ -1,6 +1,7 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
+#include <syslog.h>
#include "cmpidt.h"
#include "cmpimacs.h"
@@ -9,6 +10,7 @@
#include "objectImpl.h"
#include "control.h"
#include "array.h"
+#include "mlog.h"
#define VERSION "0.8.0"
@@ -432,6 +434,7 @@
}
+ startLogging(LOG_INFO,0);
// now let's get to work
char *ns = namespace;
char *clsname = classname;
Index: ChangeLog
===================================================================
RCS file: /cvsroot/sblim/sfcb/ChangeLog,v
retrieving revision 1.713
retrieving revision 1.714
diff -u -d -r1.713 -r1.714
--- ChangeLog 15 Feb 2012 19:44:09 -0000 1.713
+++ ChangeLog 17 Feb 2012 22:54:59 -0000 1.714
@@ -1,3 +1,9 @@
+2012-02-17 Michael Chase-Salerno <br...@li...>
+
+ * mlog.c, mlog.h, cimcClientSfcbLocal.c,
+ sfcBroker.c,sfcbinst2mof.c:
+ [ 3488688 ] Don't spawn logger for clients
+
2012-02-15 Michael Chase-Salerno <br...@li...>
* mlog.c:
Index: sfcBroker.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/sfcBroker.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -d -r1.59 -r1.60
--- sfcBroker.c 11 Feb 2012 18:51:58 -0000 1.59
+++ sfcBroker.c 17 Feb 2012 22:54:59 -0000 1.60
@@ -646,7 +646,7 @@
usage(1);
}
- startLogging(syslogLevel);
+ startLogging(syslogLevel,1);
mlogf(M_INFO,M_SHOW,"--- %s V" sfcHttpDaemonVersion " started - %d\n", name, currentProc);
Index: mlog.h
===================================================================
RCS file: /cvsroot/sblim/sfcb/mlog.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- mlog.h 7 Apr 2010 20:54:11 -0000 1.6
+++ mlog.h 17 Feb 2012 22:54:59 -0000 1.7
@@ -29,7 +29,7 @@
#define LOG_MSG_MAX 4096
-void startLogging(int level);
+void startLogging(int level, int thread);
void closeLogging();
void mlogf(int priority, int errout, const char* fmt, ...);
Index: NEWS
===================================================================
RCS file: /cvsroot/sblim/sfcb/NEWS,v
retrieving revision 1.636
retrieving revision 1.637
diff -u -d -r1.636 -r1.637
--- NEWS 15 Feb 2012 19:44:09 -0000 1.636
+++ NEWS 17 Feb 2012 22:54:59 -0000 1.637
@@ -10,6 +10,8 @@
- 3446179 Add a feature to validate CMPI types
- 3484025 Disable indication sequencing
- 3462309 Do not allow multiple instances of sfcb
+- 3488688 Don't spawn logger for clients
+
Bugs fixed:
Index: cimcClientSfcbLocal.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/cimcClientSfcbLocal.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- cimcClientSfcbLocal.c 27 Sep 2011 15:31:48 -0000 1.43
+++ cimcClientSfcbLocal.c 17 Feb 2012 22:54:59 -0000 1.44
@@ -2035,7 +2035,7 @@
env->hdl=NULL;
env->ft=&localFT;
// enable logging when called from sfcc
- startLogging(LOG_ERR);
+ startLogging(LOG_ERR,0);
// enable trace logging
_SFCB_TRACE_INIT();
Index: mlog.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/mlog.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- mlog.c 15 Feb 2012 19:44:09 -0000 1.13
+++ mlog.c 17 Feb 2012 22:54:59 -0000 1.14
@@ -30,6 +30,11 @@
#include <signal.h>
#include "trace.h" /* for setSignal() */
#include <sys/wait.h>
+
+// Macro to open the syslog
+#define OPENLOG(level) openlog("sfcb", LOG_PID, LOG_DAEMON); setlogmask(LOG_UPTO(level));
+
+
FILE *log_w_stream;
int logfds[2] = { 0, 0 };
@@ -44,11 +49,10 @@
int priosysl;
char buf[LOG_MSG_MAX];
- openlog("sfcb", LOG_PID, LOG_DAEMON);
- setlogmask(LOG_UPTO(level));
+ OPENLOG(level);
stream = fdopen(listenFd, "r");
-
+
while (!feof(stream)) {
fgets(buf, sizeof(buf), stream);
@@ -78,9 +82,18 @@
/*
* sets up the logging pipe and forks off the logger process
*/
-void startLogging(int level) {
+void startLogging(int level, int thread) {
+
+ // if we're a client, just open the log and
+ // don't start a logger.
+ if (! thread ) {
+ OPENLOG(level);
+ return;
+ }
+
pipe(logfds);
int lpid;
+
lpid = fork();
if (lpid == 0) {
|